Просмотр исходного кода

token moved to config.json

master
LeoTheHuman 8 лет назад
Родитель
Сommit
ed6ec622fc
1 измененных файлов: 4 добавлений и 3 удалений
  1. 4
    3
      magic-judge-telegram-bot.py

+ 4
- 3
magic-judge-telegram-bot.py Просмотреть файл

dispatcher.add_handler(CallbackQueryHandler(callback_name)) dispatcher.add_handler(CallbackQueryHandler(callback_name))
dispatcher.add_handler(MessageHandler(Filters.text, text)) 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) dispatcher_setup(updater.dispatcher)
updater.start_polling() updater.start_polling()
updater.idle() updater.idle()

Загрузка…
Отмена
Сохранить