def main():
token = os.getenv('VOCABOT_TOKEN')
if not token:
logging.critical('NO TOKEN FOUND!')
sys.exit()
updater = Updater(token)
# Now we know bot name, set the user-agent of vocadb api session
voca_db.set_name(updater.bot.name)
dp = updater.dispatcher
# Add main handlers
dp = add_update_handlers(dp)
# Also add our "log everything" error handler
dp.add_error_handler(error)
# Start fetching updates, we might wanna use webhooks instead at some points.
updater.start_polling()
# Loop till we quit
updater.idle()
评论列表
文章目录