diff options
Diffstat (limited to 'src/telegram_handler.py')
| -rw-r--r-- | src/telegram_handler.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/telegram_handler.py b/src/telegram_handler.py index 6213445..4ccc83e 100644 --- a/src/telegram_handler.py +++ b/src/telegram_handler.py @@ -7,13 +7,12 @@ import yaml class Telegram: def __init__(self, config: dict): - config: dict = config - bot = telegram.Bot(config['token']) - breakpoint() - asyncio.run(init_bot()) + self.config: dict = config + self.bot = telegram.Bot(config['token']) + asyncio.run(self.init_bot()) def send_message(self, text): - asyncio.run(async_send_message(text)) + asyncio.run(self.async_send_message(text)) async def async_send_message(self, text): @@ -22,6 +21,6 @@ class Telegram: async def init_bot(self): - async with bot: - print(await bot.get_me()) + async with self.bot: + print(await self.bot.get_me()) |
