Bump version to v6.0.0

This commit is contained in:
Jannes Höke 2017-05-19 21:49:01 +02:00
parent 5dd3a660e3
commit 6479e15578
8 changed files with 33 additions and 15 deletions

View file

@ -2,6 +2,27 @@
Changes 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** **2017-04-17**
*Released 5.3.1* *Released 5.3.1*

View file

@ -59,9 +59,9 @@ author = u'Leandro Toledo'
# built documents. # built documents.
# #
# The short X.Y version. # 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. # 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 # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.

View file

@ -56,7 +56,7 @@ def gender(bot, update):
def photo(bot, update): def photo(bot, update):
user = update.message.from_user 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') photo_file.download('user_photo.jpg')
logger.info("Photo of %s: %s" % (user.first_name, '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, ' update.message.reply_text('Gorgeous! Now, send me your location please, '

View file

@ -20,7 +20,7 @@ def main():
# get the first pending update_id, this is so we can skip over it in case # get the first pending update_id, this is so we can skip over it in case
# we get an "Unauthorized" exception. # we get an "Unauthorized" exception.
try: try:
update_id = bot.getUpdates()[0].update_id update_id = bot.get_updates()[0].update_id
except IndexError: except IndexError:
update_id = None update_id = None
@ -39,9 +39,7 @@ def main():
def echo(bot): def echo(bot):
global update_id global update_id
# Request updates after the last update_id # Request updates after the last update_id
for update in bot.getUpdates(offset=update_id, timeout=10): for update in bot.get_updates(offset=update_id, timeout=10):
# chat_id is required to reply to any message
chat_id = update.message.chat_id
update_id = update.update_id + 1 update_id = update.update_id + 1
if update.message: # your bot can receive updates without messages if update.message: # your bot can receive updates without messages

View file

@ -72,7 +72,7 @@ def inlinequery(bot, update):
def error(bot, update, error): 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(): def main():

View file

@ -26,7 +26,7 @@ def start(bot, update):
def button(bot, update): def button(bot, update):
query = update.callback_query query = update.callback_query
bot.editMessageText(text="Selected option: %s" % query.data, bot.edit_message_text(text="Selected option: %s" % query.data,
chat_id=query.message.chat_id, chat_id=query.message.chat_id,
message_id=query.message.message_id) message_id=query.message.message_id)

View file

@ -35,7 +35,7 @@ def start(bot, update):
def alarm(bot, job): def alarm(bot, job):
"""Function to send the alarm message""" """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): def set(bot, update, args, job_queue, chat_data):
@ -49,9 +49,8 @@ def set(bot, update, args, job_queue, chat_data):
return return
# Add job to queue # 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 chat_data['job'] = job
job_queue.put(job)
update.message.reply_text('Timer successfully set!') update.message.reply_text('Timer successfully set!')

View file

@ -17,4 +17,4 @@
# You should have received a copy of the GNU Lesser Public License # You should have received a copy of the GNU Lesser Public License
# along with this program. If not, see [http://www.gnu.org/licenses/]. # along with this program. If not, see [http://www.gnu.org/licenses/].
__version__ = '5.3.1' __version__ = '6.0.0'