from bot import Bot from views import views from threading import Thread import traceback import os config = { 'mongo': os.getenv('DB'), 'name': 'ranteabot' if not os.getenv('DEBUG') else 'flazhokbot', 'token': os.getenv('TOKEN'), 'template_files': ['templates.txt'], 'main_keyboard': {'en': [['ℹ️ About']], 'ru': [['ℹ️ О боте']]} } bot = Bot(config) views(bot) if __name__ == '__main__': Thread(target=bot.actions_loop).start() while True: try: bot.polling(none_stop=True) except: print(traceback.format_exc())