Skip to content

Commit 137ffe2

Browse files
committed
Merge remote-tracking branch 'origin/master' into payment
2 parents c4b7867 + ee1cf6b commit 137ffe2

36 files changed

+736
-104
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[submodule "telegram/vendor/urllib3"]
2-
path = telegram/vendor/urllib3
2+
path = telegram/vendor/ptb_urllib3
33
url = https://github.com/python-telegram-bot/urllib3.git
44
branch = ptb

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
hooks:
44
- id: yapf
55
files: ^(telegram|tests)/.*\.py$
6+
args:
7+
- --diff
68
- repo: git://github.com/pre-commit/pre-commit-hooks
79
sha: 18d7035de5388cc7775be57f529c154bf541aab9
810
hooks:

CHANGES.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,40 @@
22
Changes
33
=======
44

5+
**2017-05-29**
6+
7+
*Released 6.0.2*
8+
9+
- Avoid confusion with user's ``urllib3`` by renaming vendored ``urllib3`` to ``ptb_urllib3``
10+
11+
**2017-05-19**
12+
13+
*Released 6.0.1*
14+
15+
- Add support for ``User.language_code``
16+
- Fix ``Message.text_html`` and ``Message.text_markdown`` for messages with emoji
17+
18+
**2017-05-19**
19+
20+
*Released 6.0.0*
21+
22+
- Add support for Bot API 2.3.1
23+
- Add support for ``deleteMessage`` API method
24+
- New, simpler API for ``JobQueue`` - https://github.com/python-telegram-bot/python-telegram-bot/pull/484
25+
- Download files into file-like objects - https://github.com/python-telegram-bot/python-telegram-bot/pull/459
26+
- Use vendor ``urllib3`` to address issues with timeouts
27+
- The default timeout for messages is now 5 seconds. For sending media, the default timeout is now 20 seconds.
28+
- String attributes that are not set are now ``None`` by default, instead of empty strings
29+
- Add ``text_markdown`` and ``text_html`` properties to ``Message`` - https://github.com/python-telegram-bot/python-telegram-bot/pull/507
30+
- Add support for Socks5 proxy - https://github.com/python-telegram-bot/python-telegram-bot/pull/518
31+
- Add support for filters in ``CommandHandler`` - https://github.com/python-telegram-bot/python-telegram-bot/pull/536
32+
- Add the ability to invert (not) filters - https://github.com/python-telegram-bot/python-telegram-bot/pull/552
33+
- Add ``Filters.group`` and ``Filters.private``
34+
- Compatibility with GAE via ``urllib3.contrib`` package - https://github.com/python-telegram-bot/python-telegram-bot/pull/583
35+
- Add equality rich comparision operators to telegram objects - https://github.com/python-telegram-bot/python-telegram-bot/pull/604
36+
- Several bugfixes and other improvements
37+
- Remove some deprecated code
38+
539
**2017-04-17**
640

741
*Released 5.3.1*
@@ -52,6 +86,7 @@ Changes
5286

5387
- Rework ``JobQueue``
5488
- Introduce ``ConversationHandler``
89+
- Introduce ``telegram.constants`` - https://github.com/python-telegram-bot/python-telegram-bot/pull/342
5590

5691
**2016-07-12**
5792

README.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,13 @@ make the development of bots easy and straightforward. These classes are contain
8484
Telegram API support
8585
====================
8686

87-
As of **4. Dec 2016**, all types and methods of the Telegram Bot API are supported.
87+
As of **21. May 2017**, all types and methods of the Telegram Bot API 2.3.1 are supported. Additionally, the ``deleteMessage`` API function and the field ``User.language_code`` are supported.
88+
89+
Also, version 6.1 beta 0 is available, offering full but experimental Bot API 3.0 coverage:
90+
91+
.. code:: shell
92+
93+
$ pip install python-telegram-bot==6.1b0
8894
8995
==========
9096
Installing

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959
# built documents.
6060
#
6161
# The short X.Y version.
62-
version = '5.3' # telegram.__version__[:3]
62+
version = '6.0' # telegram.__version__[:3]
6363
# The full version, including alpha/beta/rc tags.
64-
release = '5.3.1' # telegram.__version__
64+
release = '6.0.2' # telegram.__version__
6565

6666
# The language for content autogenerated by Sphinx. Refer to documentation
6767
# for a list of supported languages.

examples/conversationbot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def gender(bot, update):
5656

5757
def photo(bot, update):
5858
user = update.message.from_user
59-
photo_file = bot.getFile(update.message.photo[-1].file_id)
59+
photo_file = bot.get_file(update.message.photo[-1].file_id)
6060
photo_file.download('user_photo.jpg')
6161
logger.info("Photo of %s: %s" % (user.first_name, 'user_photo.jpg'))
6262
update.message.reply_text('Gorgeous! Now, send me your location please, '

examples/echobot.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def main():
2020
# get the first pending update_id, this is so we can skip over it in case
2121
# we get an "Unauthorized" exception.
2222
try:
23-
update_id = bot.getUpdates()[0].update_id
23+
update_id = bot.get_updates()[0].update_id
2424
except IndexError:
2525
update_id = None
2626

@@ -39,9 +39,7 @@ def main():
3939
def echo(bot):
4040
global update_id
4141
# Request updates after the last update_id
42-
for update in bot.getUpdates(offset=update_id, timeout=10):
43-
# chat_id is required to reply to any message
44-
chat_id = update.message.chat_id
42+
for update in bot.get_updates(offset=update_id, timeout=10):
4543
update_id = update.update_id + 1
4644

4745
if update.message: # your bot can receive updates without messages

examples/inlinebot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def inlinequery(bot, update):
7272

7373

7474
def error(bot, update, error):
75-
logger.warn('Update "%s" caused error "%s"' % (update, error))
75+
logger.warning('Update "%s" caused error "%s"' % (update, error))
7676

7777

7878
def main():

examples/inlinekeyboard.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ def start(bot, update):
2626
def button(bot, update):
2727
query = update.callback_query
2828

29-
bot.editMessageText(text="Selected option: %s" % query.data,
30-
chat_id=query.message.chat_id,
31-
message_id=query.message.message_id)
29+
bot.edit_message_text(text="Selected option: %s" % query.data,
30+
chat_id=query.message.chat_id,
31+
message_id=query.message.message_id)
3232

3333

3434
def help(bot, update):

examples/timerbot.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def start(bot, update):
3535

3636
def alarm(bot, job):
3737
"""Function to send the alarm message"""
38-
bot.sendMessage(job.context, text='Beep!')
38+
bot.send_message(job.context, text='Beep!')
3939

4040

4141
def set(bot, update, args, job_queue, chat_data):
@@ -49,9 +49,8 @@ def set(bot, update, args, job_queue, chat_data):
4949
return
5050

5151
# Add job to queue
52-
job = Job(alarm, due, repeat=False, context=chat_id)
52+
job = job_queue.run_once(alarm, due, context=chat_id)
5353
chat_data['job'] = job
54-
job_queue.put(job)
5554

5655
update.message.reply_text('Timer successfully set!')
5756

0 commit comments

Comments
 (0)