瀏覽代碼

token moved to config.json

master
LeoTheHuman 8 年之前
父節點
當前提交
ed6ec622fc
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4
    3
      magic-judge-telegram-bot.py

+ 4
- 3
magic-judge-telegram-bot.py 查看文件

@@ -241,9 +241,10 @@ def dispatcher_setup(dispatcher):
dispatcher.add_handler(CallbackQueryHandler(callback_name))
dispatcher.add_handler(MessageHandler(Filters.text, text))

with open('token') as file:
token = file.read().strip()
updater = Updater(token)
with open('config.json') as file:
config = json.load(file)

updater = Updater(config['token'])
dispatcher_setup(updater.dispatcher)
updater.start_polling()
updater.idle()

Loading…
取消
儲存