Aioworkers Plugin for Teleggram
aioworkers-tg的Python项目详细描述
使用aiowworkers中的telegram的插件。
功能:
- 电报用户。
- 电报频道。
- 电报组。
用法
使用pip安装:
pip install aioworkers-tg
在aioworkers配置中创建bot实体:
bot:cls:'aioworkers_tg.bot.TelegramBot'api_token:'1234567890'
您可以直接从上下文中使用它:
awaitcontext.bot.channel('@yourchannel').send_text("Hello from channel!")
也可以创建聊天实例并直接发送消息:
chat:cls:'aioworkers_tg.chat.TelegramChat'bot:'bot'# reference to created botgroup_id:'11111'
awaitcontext.chat.send_text("Hello!")