From 666ab7609de91ac1b420047d10d15b9e4a4f8608 Mon Sep 17 00:00:00 2001 From: pieter Date: Fri, 3 Jul 2015 19:28:04 +0200 Subject: [PATCH] Fix TeleBot#extract_command where the function previously would incorrectly slice /command@botname --- telebot/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/telebot/__init__.py b/telebot/__init__.py index e549394..62d1971 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -287,13 +287,14 @@ class TeleBot: Examples: extract_command('/help'): 'help' + extract_command('/help@BotName'): 'help' extract_command('/search black eyed peas'): 'search' extract_command('Good day to you'): None :param text: String to extract the command from :return: the command if `text` is a command, else None. """ - return text.split()[0][1:] if TeleBot.is_command(text) else None + return text.split()[0].split('@')[0][1:] if TeleBot.is_command(text) else None @staticmethod def _test_message_handler(message_handler, message):