dragxd commited on
Commit
f5cff50
·
verified ·
1 Parent(s): 4b226cd

Update Mikobot/__init__.py

Browse files
Files changed (1) hide show
  1. Mikobot/__init__.py +21 -0
Mikobot/__init__.py CHANGED
@@ -18,6 +18,7 @@ from telegram.constants import ParseMode
18
  from telegram.ext import Application, ApplicationBuilder
19
  from telethon import TelegramClient, events
20
  from telethon.sessions import MemorySession, StringSession
 
21
 
22
  # <=======================================================================================================>
23
 
@@ -244,3 +245,23 @@ WOLVES = list(WOLVES)
244
  DEMONS = list(DEMONS)
245
  TIGERS = list(TIGERS)
246
  # <==================================================== END ===================================================>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  from telegram.ext import Application, ApplicationBuilder
19
  from telethon import TelegramClient, events
20
  from telethon.sessions import MemorySession, StringSession
21
+ from bot_init import initialize_with_retry, run_bot
22
 
23
  # <=======================================================================================================>
24
 
 
245
  DEMONS = list(DEMONS)
246
  TIGERS = list(TIGERS)
247
  # <==================================================== END ===================================================>
248
+
249
+
250
+
251
+ async def main():
252
+ try:
253
+ # Initialize the bot with retry logic
254
+ application = await initialize_with_retry(bot_token=YOUR_BOT_TOKEN)
255
+
256
+ # Add your handlers here
257
+ # application.add_handler(...)
258
+
259
+ # Run the bot
260
+ await run_bot(application)
261
+
262
+ except Exception as e:
263
+ logging.error(f"Fatal error: {str(e)}")
264
+ raise
265
+
266
+ if __name__ == '__main__':
267
+ asyncio.run(main())