Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion telegram/ext/commandhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def check_update(self, update):
res = self.filters(message)

return res and (message.text.startswith('/') and command[0] == self.command
and command[1] == update.message.bot.username)
and command[1].lower() == update.message.bot.username.lower())
else:
return False

Expand Down
2 changes: 1 addition & 1 deletion telegram/ext/messagequeue.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
# on Windows, the best available is time.clock while time.time is on
# another platforms (M. Lutz, "Learning Python," 4ed, p.630-634)
if sys.version_info.major == 3 and sys.version_info.minor >= 3:
curtime = time.perf_counter
curtime = time.perf_counter # pylint: disable=E1101
else:
curtime = time.clock if sys.platform[:3] == 'win' else time.time

Expand Down
4 changes: 4 additions & 0 deletions tests/test_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ def test_addRemoveTelegramCommandHandler(self):
queue.put(Update(update_id=0, message=message))
sleep(.1)
self.assertEqual(self.received_message, '/test@MockBot')
message.text = "/test@mockbot"
queue.put(Update(update_id=0, message=message))
sleep(.1)
self.assertEqual(self.received_message, '/test@mockbot')

# directed at other bot
self.reset()
Expand Down