From 3b590d9fca20857d1920b56ea7067d5a0b711991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannes=20H=C3=B6ke?= Date: Fri, 29 Apr 2016 11:12:56 +0200 Subject: [PATCH] adjust for python-telegram-bot 4.0.1 --- README.md | 2 +- bot.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0483afd..3fe0406 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Telegram Bot that allows you to play the popular card game UNO via inline querie To run the bot yourself, you will need: - Python (tested with 3.4) -- The [python-telegram-bot](https://github.com/python-telegram-bot/python-telegram-bot) module (currently using ``dispatcher-rework`` beta branch) +- The [python-telegram-bot](https://github.com/python-telegram-bot/python-telegram-bot) module version 4.0.1 Get a bot token from [@BotFather](http://telegram.me/BotFather), place it in `credentials.py` and run the bot with `python3 bot.py` diff --git a/bot.py b/bot.py index bcbc228..3382df8 100644 --- a/bot.py +++ b/bot.py @@ -8,7 +8,7 @@ from telegram import InlineQueryResultArticle, ParseMode, Message, Chat, \ InlineQueryResultCachedSticker as Sticker, InlineKeyboardMarkup, \ InlineKeyboardButton from telegram.ext import Updater, InlineQueryHandler, \ - ChosenInlineResultHandler, CommandHandler, MessageHandler, filters, \ + ChosenInlineResultHandler, CommandHandler, MessageHandler, Filters, \ CallbackQueryHandler from telegram.ext.dispatcher import run_async from telegram.utils.botan import Botan @@ -640,7 +640,7 @@ dp.addHandler(CommandHandler('close', close_game)) dp.addHandler(CommandHandler('skip', skip_player)) dp.addHandler(CommandHandler('help', help)) dp.addHandler(CommandHandler('news', news)) -dp.addHandler(MessageHandler([filters.STATUS_UPDATE], status_update)) +dp.addHandler(MessageHandler([Filters.status_update], status_update)) dp.addErrorHandler(error) start_bot(u)