Skip to content

Latest commit

 

History

History
80 lines (43 loc) · 1.35 KB

README.rst

File metadata and controls

80 lines (43 loc) · 1.35 KB

aioworkers-tg

https://travis-ci.org/aioworkers/aioworkers-tg.svg?branch=master Python versions

Plugin to work with Telegram in aioworkers.

Features:

  • Telegram user.
  • Telegram channels.
  • Telegram groups.

Usage

Install it with pip:

pip install aioworkers-tg

Create entity of bot in aioworkers config:

bot:
    cls: 'aioworkers_tg.bot.TelegramBot'
    api_token: '1234567890'

You can use it directly from context:

await context.bot.channel('@yourchannel').send_text("Hello from channel!")

Also it is possible to create chat instance and send messages directly:

chat:
    cls: 'aioworkers_tg.chat.TelegramChat'
    bot: 'bot' # reference to created bot
    group_id: '11111'
await context.chat.send_text("Hello!")

Development

Install dev requirements:

pipenv install --dev --skip-lock

Run tests:

pytest