Skip to content

Commit 2954ca2

Browse files
committed
🔀 Merge master into fix-460
python-telegram-bot#494
2 parents e69e99c + 34ebb7f commit 2954ca2

30 files changed

Lines changed: 610 additions & 216 deletions

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ python:
44
- "3.3"
55
- "3.4"
66
- "3.5"
7+
- "3.6"
78
- "pypy"
89
- "pypy3"
910
branches:

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The following wonderful people contributed directly or indirectly to this projec
1212
- `Anton Tagunov <https://github.com/anton-tagunov>`_
1313
- `Balduro <https://github.com/Balduro>`_
1414
- `bimmlerd <https://github.com/bimmlerd>`_
15+
- `daimajia <https://github.com/daimajia>`_
1516
- `Eli Gao <https://github.com/eligao>`_
1617
- `ErgoZ Riftbit Vaper <https://github.com/ergoz>`_
1718
- `Eugene Lisitsky <https://github.com/lisitsky>`_

examples/conversationbot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def main():
149149
# Start the Bot
150150
updater.start_polling()
151151

152-
# Run the bot until the you presses Ctrl-C or the process receives SIGINT,
152+
# Run the bot until you press Ctrl-C or the process receives SIGINT,
153153
# SIGTERM or SIGABRT. This should be used most of the time, since
154154
# start_polling() is non-blocking and will stop the bot gracefully.
155155
updater.idle()

examples/conversationbot2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def main():
142142
# Start the Bot
143143
updater.start_polling()
144144

145-
# Run the bot until the you presses Ctrl-C or the process receives SIGINT,
145+
# Run the bot until you press Ctrl-C or the process receives SIGINT,
146146
# SIGTERM or SIGABRT. This should be used most of the time, since
147147
# start_polling() is non-blocking and will stop the bot gracefully.
148148
updater.idle()

examples/echobot2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def main():
6464
# Start the Bot
6565
updater.start_polling()
6666

67-
# Run the bot until the you presses Ctrl-C or the process receives SIGINT,
67+
# Run the bot until you press Ctrl-C or the process receives SIGINT,
6868
# SIGTERM or SIGABRT. This should be used most of the time, since
6969
# start_polling() is non-blocking and will stop the bot gracefully.
7070
updater.idle()

examples/timerbot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ def main():
9898
# Start the Bot
9999
updater.start_polling()
100100

101-
# Block until the you presses Ctrl-C or the process receives SIGINT,
102-
# SIGTERM or SIGABRT. This should be used most of the time, since
103-
# start_polling() is non-blocking and will stop the bot gracefully.
101+
# Block until you press Ctrl-C or the process receives SIGINT, SIGTERM or
102+
# SIGABRT. This should be used most of the time, since start_polling() is
103+
# non-blocking and will stop the bot gracefully.
104104
updater.idle()
105105

106106

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def requirements():
3636
install_requires=requirements(),
3737
extras_require={
3838
'json': 'ujson',
39+
'socks': 'PySocks'
3940
},
4041
include_package_data=True,
4142
classifiers=[
@@ -53,4 +54,5 @@ def requirements():
5354
'Programming Language :: Python :: 3.3',
5455
'Programming Language :: Python :: 3.4',
5556
'Programming Language :: Python :: 3.5',
57+
'Programming Language :: Python :: 3.6'
5658
],)

telegram/bot.py

Lines changed: 147 additions & 76 deletions
Large diffs are not rendered by default.

telegram/chat.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Chat(TelegramObject):
3232
username (str): Username, for private chats and channels if available
3333
first_name (str): First name of the other party in a private chat
3434
last_name (str): Last name of the other party in a private chat
35-
all_members_are_admins (bool): True if a group has 'All Members Are Admins' enabled.
35+
all_members_are_administrators (bool): True if group has 'All Members Are Administrators'
3636
3737
Args:
3838
id (int):
@@ -57,7 +57,7 @@ def __init__(self,
5757
username=None,
5858
first_name=None,
5959
last_name=None,
60-
all_members_are_admins=None,
60+
all_members_are_administrators=None,
6161
bot=None,
6262
**kwargs):
6363
# Required
@@ -68,7 +68,7 @@ def __init__(self,
6868
self.username = username
6969
self.first_name = first_name
7070
self.last_name = last_name
71-
self.all_members_are_admins = all_members_are_admins
71+
self.all_members_are_administrators = all_members_are_administrators
7272

7373
self.bot = bot
7474

telegram/ext/commandhandler.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,14 @@ def check_update(self, update):
8383
and (update.message or update.edited_message and self.allow_edited)):
8484
message = update.message or update.edited_message
8585

86-
return (message.text and message.text.startswith('/')
87-
and message.text[1:].split(' ')[0].split('@')[0] == self.command)
86+
if message.text:
87+
command = message.text[1:].split(' ')[0].split('@')
88+
command.append(
89+
update.message.bot.username) # in case the command was send without a username
90+
return (message.text.startswith('/') and command[0] == self.command
91+
and command[1] == update.message.bot.username)
92+
else:
93+
return False
8894

8995
else:
9096
return False

0 commit comments

Comments
 (0)