Advertisement
xm4dn355x

WTF????

Oct 6th, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. from telegram.utils.request import Request
  2. from telegram import Bot
  3. from telegram.ext import CommandHandler, Updater
  4. from bot_config import API_TOKEN
  5.  
  6. from bot_decorators import log_error
  7. import bot_timers as alerts
  8.  
  9.  
  10. req = Request(connect_timeout=3)
  11. bot = Bot(request=req, token=API_TOKEN)
  12. updater = Updater(bot=bot, use_context=True)
  13. dispatcher = updater.dispatcher
  14.  
  15. # ALERTS_TIMERS_EVENT_LOOP = alerts.run_timers_event_loop(bot=bot)
  16.  
  17.  
  18. @log_error
  19. def start(update, context):
  20.     context.bot.send_message(chat_id=update.effective_chat.id, text="Запуск ивент лупа")
  21.     timers_event_loop = alerts.run_timers_event_loop(bot=bot)
  22.     timers_event_loop.start()
  23.     # ALERTS_TIMERS_EVENT_LOOP.start()
  24.  
  25.  
  26. start_handler = CommandHandler('start', start)
  27. dispatcher.add_handler(start_handler)
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement