about summary refs log tree commit diff
path: root/src/telegram_handler.py
diff options
context:
space:
mode:
authoruser <user@node5.net>2025-03-30 16:57:00 +0200
committeruser <user@node5.net>2025-03-30 16:57:00 +0200
commita4b06f083ac0dca045994b891a1e49c63ba3a20a (patch)
treecc1fdcbc2821b5984c8cef9607e57ce01523a4f0 /src/telegram_handler.py
parent1ec84a082d2cba27ae44e4fcb1edb9d7d59602e9 (diff)
Python - Fix after refactor
Diffstat (limited to 'src/telegram_handler.py')
-rw-r--r--src/telegram_handler.py13
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())