feat(telegram): add basic bot for sending messages
This commit is contained in:
11
telegram_bot.py
Normal file
11
telegram_bot.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import telegram
|
||||||
|
|
||||||
|
class Telegram:
|
||||||
|
def __init__(self, token, channel_id):
|
||||||
|
self.token = token
|
||||||
|
self.bot = telegram.Bot(token=token)
|
||||||
|
self.channel_id = channel_id
|
||||||
|
|
||||||
|
|
||||||
|
async def send_message(self, message: str):
|
||||||
|
print(await self.bot.send_message(chat_id=self.channel_id, text=message))
|
||||||
Reference in New Issue
Block a user