From 6479e1557873803ad75e939bcf3e3b57522e09ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannes=20H=C3=B6ke?= Date: Fri, 19 May 2017 21:49:01 +0200 Subject: [PATCH] Bump version to v6.0.0 --- CHANGES.rst | 21 +++++++++++++++++++++ docs/source/conf.py | 4 ++-- examples/conversationbot.py | 2 +- examples/echobot.py | 6 ++---- examples/inlinebot.py | 2 +- examples/inlinekeyboard.py | 6 +++--- examples/timerbot.py | 5 ++--- telegram/version.py | 2 +- 8 files changed, 33 insertions(+), 15 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index a979e8411..213fb1a7d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,6 +2,27 @@ Changes ======= +**2017-05-19** + +*Released 6.0.0* + +- Add support for Bot API 2.3.1 +- Add support for ``deleteMessage`` API method +- New, simpler API for ``JobQueue`` - https://github.com/python-telegram-bot/python-telegram-bot/pull/484 +- Download files into file-like objects - https://github.com/python-telegram-bot/python-telegram-bot/pull/459 +- Use vendor ``urllib3`` to address issues with timeouts + - The default timeout for messages is now 5 seconds. For sending media, the default timeout is now 20 seconds. +- String attributes that are not set are now ``None`` by default, instead of empty strings +- Add ``text_markdown`` and ``text_html`` properties to ``Message`` - https://github.com/python-telegram-bot/python-telegram-bot/pull/507 +- Add support for Socks5 proxy - https://github.com/python-telegram-bot/python-telegram-bot/pull/518 +- Add support for filters in ``CommandHandler`` - https://github.com/python-telegram-bot/python-telegram-bot/pull/536 +- Add the ability to invert (not) filters - https://github.com/python-telegram-bot/python-telegram-bot/pull/552 +- Add ``Filters.group`` and ``Filters.private`` +- Compatibility with GAE via ``urllib3.contrib`` package - https://github.com/python-telegram-bot/python-telegram-bot/pull/583 +- Add equality rich comparision operators to telegram objects - https://github.com/python-telegram-bot/python-telegram-bot/pull/604 +- Several bugfixes and other improvements +- Remove some deprecated code + **2017-04-17** *Released 5.3.1* diff --git a/docs/source/conf.py b/docs/source/conf.py index 13f1adb34..c49c1c28b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -59,9 +59,9 @@ author = u'Leandro Toledo' # built documents. # # The short X.Y version. -version = '5.3' # telegram.__version__[:3] +version = '6.0' # telegram.__version__[:3] # The full version, including alpha/beta/rc tags. -release = '5.3.1' # telegram.__version__ +release = '6.0.0' # telegram.__version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/examples/conversationbot.py b/examples/conversationbot.py index 96a25a6d9..6dcff8643 100644 --- a/examples/conversationbot.py +++ b/examples/conversationbot.py @@ -56,7 +56,7 @@ def gender(bot, update): def photo(bot, update): user = update.message.from_user - photo_file = bot.getFile(update.message.photo[-1].file_id) + photo_file = bot.get_file(update.message.photo[-1].file_id) photo_file.download('user_photo.jpg') logger.info("Photo of %s: %s" % (user.first_name, 'user_photo.jpg')) update.message.reply_text('Gorgeous! Now, send me your location please, ' diff --git a/examples/echobot.py b/examples/echobot.py index afe532060..b7e6e0a4a 100644 --- a/examples/echobot.py +++ b/examples/echobot.py @@ -20,7 +20,7 @@ def main(): # get the first pending update_id, this is so we can skip over it in case # we get an "Unauthorized" exception. try: - update_id = bot.getUpdates()[0].update_id + update_id = bot.get_updates()[0].update_id except IndexError: update_id = None @@ -39,9 +39,7 @@ def main(): def echo(bot): global update_id # Request updates after the last update_id - for update in bot.getUpdates(offset=update_id, timeout=10): - # chat_id is required to reply to any message - chat_id = update.message.chat_id + for update in bot.get_updates(offset=update_id, timeout=10): update_id = update.update_id + 1 if update.message: # your bot can receive updates without messages diff --git a/examples/inlinebot.py b/examples/inlinebot.py index 2db044d10..457ef5bc1 100644 --- a/examples/inlinebot.py +++ b/examples/inlinebot.py @@ -72,7 +72,7 @@ def inlinequery(bot, update): def error(bot, update, error): - logger.warn('Update "%s" caused error "%s"' % (update, error)) + logger.warning('Update "%s" caused error "%s"' % (update, error)) def main(): diff --git a/examples/inlinekeyboard.py b/examples/inlinekeyboard.py index 326581a9f..4966702b0 100644 --- a/examples/inlinekeyboard.py +++ b/examples/inlinekeyboard.py @@ -26,9 +26,9 @@ def start(bot, update): def button(bot, update): query = update.callback_query - bot.editMessageText(text="Selected option: %s" % query.data, - chat_id=query.message.chat_id, - message_id=query.message.message_id) + bot.edit_message_text(text="Selected option: %s" % query.data, + chat_id=query.message.chat_id, + message_id=query.message.message_id) def help(bot, update): diff --git a/examples/timerbot.py b/examples/timerbot.py index 6c54fb5a0..2a7d7cbe2 100644 --- a/examples/timerbot.py +++ b/examples/timerbot.py @@ -35,7 +35,7 @@ def start(bot, update): def alarm(bot, job): """Function to send the alarm message""" - bot.sendMessage(job.context, text='Beep!') + bot.send_message(job.context, text='Beep!') def set(bot, update, args, job_queue, chat_data): @@ -49,9 +49,8 @@ def set(bot, update, args, job_queue, chat_data): return # Add job to queue - job = Job(alarm, due, repeat=False, context=chat_id) + job = job_queue.run_once(alarm, due, context=chat_id) chat_data['job'] = job - job_queue.put(job) update.message.reply_text('Timer successfully set!') diff --git a/telegram/version.py b/telegram/version.py index 508ad5e16..61dad2415 100644 --- a/telegram/version.py +++ b/telegram/version.py @@ -17,4 +17,4 @@ # You should have received a copy of the GNU Lesser Public License # along with this program. If not, see [http://www.gnu.org/licenses/]. -__version__ = '5.3.1' +__version__ = '6.0.0'