def main():
# define the updater
updater = Updater(token=botconfig.bot_token)
# define the dispatcher
dp = updater.dispatcher
# messages
dp.add_handler(MessageHandler(~Filters.command, util.process_message, edited_updates=True))
dp.add_handler(CommandHandler(('start'), commands.help_command))
dp.add_handler(CommandHandler(('stats'), commands.stats_command))
dp.add_handler(CommandHandler(('globalstats'), commands.global_stats_command))
# handle errors
dp.add_error_handler(error)
updater.start_polling()
updater.idle()
评论列表
文章目录