GithubHelp home page GithubHelp logo

obervinov / telegram-package Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 387 KB

This is an additional implementation compared to the telebot module. This module is designed for quick initialization, authorization and rendering of various buttons/widgets for telegram bots.

License: MIT License

Python 96.09% HCL 3.91%
module poetry poetry-python python-module python3 telebot telegram-bot

telegram-package's People

Contributors

github-actions[bot] avatar obervinov avatar

Watchers

 avatar

telegram-package's Issues

Update workflows for this module: tests, checks, dependencies and create release

  • Bump the templates of workflow to v1.0.4
  • Remove this rule to run Tests and Checks in main branch
  • Replace the old tasks with these in Tests and Checks (added verify package and verify changelog)
jobs:
  pylint:
    uses: obervinov/_templates/.github/workflows/[email protected]
  verify-package:
    uses: obervinov/_templates/.github/workflows/[email protected]
  verify-changelog:
    uses: obervinov/_templates/.github/workflows/[email protected]
  pytest:
    uses: obervinov/_templates/.github/workflows/[email protected]
  • Completely replace the contents of the Create Release workflow with this body
name: Create GitHub Release

on:
  workflow_run:
    workflows: ["Tests and Checks"]
    branches: [main]
    types: 
      - completed
  push:
    branches: [main]
    paths: ['users/**']

jobs:
  create-release:
    uses: obervinov/_templates/.github/workflows/[email protected]

Update documentation: PR template

  • Add in PR template **full changelog**: https://github.com/obervinov/_templates/compare/1...2 by @ obervinov https://github.com/obervinov/_templates/pull/1

Add class parameters for exception handling

https://github.com/eternnoir/pyTelegramBotAPI/tree/master/telebot

2023-11-20 19:44:02 [2023-11-20 15:44:02,399] ERROR [TeleBot.__threaded_polling:1085] Exception traceback:
2023-11-20 19:44:02 Traceback (most recent call last):
2023-11-20 19:44:02   File "/home/pyinstabot-downloader/.local/lib/python3.10/site-packages/telebot/__init__.py", line 1074, in __threaded_polling
2023-11-20 19:44:02     self.worker_pool.raise_exceptions()
2023-11-20 19:44:02   File "/home/pyinstabot-downloader/.local/lib/python3.10/site-packages/telebot/util.py", line 147, in raise_exceptions
2023-11-20 19:44:02     raise self.exception_info
2023-11-20 19:44:02   File "/home/pyinstabot-downloader/.local/lib/python3.10/site-packages/telebot/util.py", line 90, in run
2023-11-20 19:44:02     task(*args, **kwargs)
2023-11-20 19:44:02   File "/home/pyinstabot-downloader/.local/lib/python3.10/site-packages/telebot/__init__.py", line 6770, in _run_middlewares_and_handler
2023-11-20 19:44:02     result = handler['function'](message)
2023-11-20 19:44:02   File "/home/pyinstabot-downloader/app/bot.py", line 94, in start_command
2023-11-20 19:44:02     reject_message(message=message)
2023-11-20 19:44:02   File "/home/pyinstabot-downloader/app/bot.py", line 253, in reject_message
2023-11-20 19:44:02     bot.send_message(
2023-11-20 19:44:02   File "/home/pyinstabot-downloader/.local/lib/python3.10/site-packages/telebot/__init__.py", line 1549, in send_message
2023-11-20 19:44:02     apihelper.send_message(
2023-11-20 19:44:02   File "/home/pyinstabot-downloader/.local/lib/python3.10/site-packages/telebot/apihelper.py", line 264, in send_message
2023-11-20 19:44:02     return _make_request(token, method_url, params=payload, method='post')
2023-11-20 19:44:02   File "/home/pyinstabot-downloader/.local/lib/python3.10/site-packages/telebot/apihelper.py", line 162, in _make_request
2023-11-20 19:44:02     json_result = _check_result(method_name, result)
2023-11-20 19:44:02   File "/home/pyinstabot-downloader/.local/lib/python3.10/site-packages/telebot/apihelper.py", line 189, in _check_result
2023-11-20 19:44:02     raise ApiTelegramException(method_name, result, result_json)
2023-11-20 19:44:02 telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 403. Description: Forbidden: bot was blocked by the user

Change the order of changes by sections in `CHANGELOG.md`

Typo

## v1.1.3 - 2023-06-20
### What's Changed
**Full Changelog**: https://github.com/obervinov/telegram-package/compare/v1.1.2...v1.1.3 by @obervinov in https://github.com/obervinov/telegram-package/pull/18
#### ๐Ÿ› Bug Fixes
* [Fix badge with tests in README.md](https://github.com/obervinov/telegram-package/issues/15)
* [Bump vault-package to v2.0.1](https://github.com/obervinov/telegram-package/issues/17)
#### ๐Ÿš€ Features
* [Fix the error that caused the workflow create_release to run twice - at pr/main](https://github.com/obervinov/telegram-package/issues/16)

Correct

## v1.1.3 - 2023-06-20
### What's Changed
**Full Changelog**: https://github.com/obervinov/telegram-package/compare/v1.1.2...v1.1.3 by @obervinov in https://github.com/obervinov/telegram-package/pull/18
#### ๐Ÿ› Bug Fixes
* [Fix badge with tests in README.md](https://github.com/obervinov/telegram-package/issues/15)
* [Fix the error that caused the workflow create_release to run twice - at pr/main](https://github.com/obervinov/telegram-package/issues/16)
#### ๐Ÿš€ Features
* [Bump vault-package to v2.0.1](https://github.com/obervinov/telegram-package/issues/17)

Fix work with transit dependencies in setup.py

  • fix install_requires
    install_requires=[
        'logger @ git+https://github.com/obervinov/[email protected]',
        'vault @ git+https://github.com/obervinov/[email protected]',
    ]
  • remove dependency_links

  • fix requirements.txt

logger @ git+https://github.com/obervinov/[email protected]
vault @ git+https://github.com/obervinov/[email protected]
  • update topics in classifiers
    classifiers=[
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python :: 3.10",
        "Operating System :: OS Independent",
        "Intended Audience :: Developers",
        "Topic :: Software Development"
    ]

Merge all workflows to single file

for example

name: Test, Build and create relese

on:
  push:
    branches:    
      - '*'
      - '*/*'
      - '**'

env:
  PROJECT_DESCRIPTION: "This project is a telegram bot that allows you to create backups of content from your Instagram profile to Dropbox or Mega clouds, as well as in the local file system."


jobs:
  pylint:
    uses: obervinov/_templates/.github/workflows/[email protected]
  verify-changelog:
    uses: obervinov/_templates/.github/workflows/[email protected]
  pytest:
    uses: obervinov/_templates/.github/workflows/[email protected]
  build-release:
    uses: obervinov/_templates/.github/workflows/build.docker.yml@release/v1.0.5
    needs: [pylint, verify-changelog, pytest]

Fix install_requires and dependency_links in setup.py

example

"""
This module is necessary to distribute and install the written module via pip
"""
from setuptools import setup

with open('README.md', 'r', encoding='utf8') as readme:
    readme_content = readme.read()
with open('CHANGELOG.md', 'r', encoding='utf8') as changelog:
    changelog_content = changelog.read()

setup(
    name='users',
    version='1.0.3',
    license='MIT',
    description=(
        "This module contains classes and functions for implementing"
        "the simplest authorization for telegram bots"
    ),
    py_modules=["users"],
    package_dir={'': 'users'},
    author='Oleg Bervinov',
    author_email='[email protected]',
    long_description=(f"{readme_content}""\n\n"f"{changelog_content}"),
    long_description_content_type="text/markdown",
    url='https://github.com/obervinov/users-package',
    include_package_data=True,
    classifiers=[
        "License :: OSI Approved :: MIT License",
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: 3.9',
        'Programming Language :: Python :: 3.10',
        'Programming Language :: Python :: 3.11',
        'Operating System :: OS Independent'
    ],
    keywords=['users', 'authentication'],
    install_requires=[
        'logger @ https://github.com/obervinov/logger-package/tarball/v1.0.1#egg=logger-1.0.1',
        'vault @ https://github.com/obervinov/vault-package/tarball/v2.0.0#egg=vault-2.0.0',
    ],
    dependency_links=[
        'https://github.com/obervinov/logger-package/tarball/v1.0.1#egg=logger-1.0.1'
        'https://github.com/obervinov/vault-package/tarball/v2.0.0#egg=vault-2.0.0'
    ]
)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.