def main():
# Create the EventHandler and pass it your bot's token.
updater = Updater("386765167:AAEAeiO5sgg5AjlQFIw6OiYWTXr1qBeQsrE")
# Get the dispatcher to register handlers
dp = updater.dispatcher
# on different commands - answer in Telegram
dp.add_handler(CommandHandler("start", start))
dp.add_handler(CommandHandler("begin_simple_arbitrage", begin_simple_arbitrage))
dp.add_handler(CommandHandler("stop_simple_arbitrage", stop_simple_arbitrage))
# on noncommand i.e message - echo the message on Telegram
dp.add_handler(MessageHandler(Filters.text, non_command))
#Start scheduler
t1 = Thread(target=ThreadFunctionScheduler, args=(updater.bot,))
t1.start()
# Start the Bot
t2 = Thread(target=ThreadBot, args=(updater,))
t2.start()
# Run the bot until you press Ctrl-C or the process receives SIGINT,
# SIGTERM or SIGABRT. This should be used most of the time, since
# start_polling() is non-blocking and will stop the bot gracefully.
updater.idle()
telegram_manager.py 文件源码
python
阅读 16
收藏 0
点赞 0
评论 0
评论列表
文章目录