From f2e0e78e4347045a0389fac89d2f40c775aa7b87 Mon Sep 17 00:00:00 2001 From: oliverhnat Date: Mon, 6 Jan 2025 12:04:15 +0100 Subject: [PATCH] feat(telegram): add basic bot for sending messages --- telegram_bot.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 telegram_bot.py diff --git a/telegram_bot.py b/telegram_bot.py new file mode 100644 index 0000000..d1a320a --- /dev/null +++ b/telegram_bot.py @@ -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))