Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aioworkers/aioworkers-tg
Plugin to work with Telegram in aioworkers
https://github.com/aioworkers/aioworkers-tg
aiotg aioworkers asyncio python telegram
Last synced: 16 days ago
JSON representation
Plugin to work with Telegram in aioworkers
- Host: GitHub
- URL: https://github.com/aioworkers/aioworkers-tg
- Owner: aioworkers
- License: apache-2.0
- Created: 2018-11-06T12:12:39.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-29T04:55:49.000Z (over 5 years ago)
- Last Synced: 2024-10-18T13:15:29.647Z (2 months ago)
- Topics: aiotg, aioworkers, asyncio, python, telegram
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
aioworkers-tg
=============.. image:: https://travis-ci.org/aioworkers/aioworkers-tg.svg?branch=master
:target: https://travis-ci.org/aioworkers/aioworkers-tg.. image:: https://img.shields.io/pypi/pyversions/aioworkers-tg.svg
:target: https://pypi.python.org/pypi/aioworkers-tg
:alt: Python versions.. image:: https://img.shields.io/pypi/v/aioworkers-tg.svg
:target: https://pypi.python.org/pypi/aioworkers-tgPlugin to work with `Telegram` in `aioworkers`.
Features:
* Telegram user.
* Telegram channels.
* Telegram groups.Usage
-----Install it with pip:
.. code:: sh
pip install aioworkers-tg
Create entity of bot in aioworkers config:
.. code-block:: yaml
bot:
cls: 'aioworkers_tg.bot.TelegramBot'
api_token: '1234567890'You can use it directly from context:
.. code-block:: python
await context.bot.channel('@yourchannel').send_text("Hello from channel!")
Also it is possible to create chat instance and send messages directly:
.. code-block:: yaml
chat:
cls: 'aioworkers_tg.chat.TelegramChat'
bot: 'bot' # reference to created bot
group_id: '11111'.. code-block:: python
await context.chat.send_text("Hello!")
Development
-----------Install dev requirements:
.. code-block:: shell
pipenv install --dev --skip-lock
Run tests:
.. code-block:: shell
pytest