From 846d5ff2ebe4d4356efa6aedfc2c63e0d1b388fd Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 1 Jan 2020 22:33:57 +0100 Subject: [PATCH] Support for underscores and minuses in Telegram command names --- platypush/backend/chat/telegram.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platypush/backend/chat/telegram.py b/platypush/backend/chat/telegram.py index d1fb06025..a0a9acae3 100644 --- a/platypush/backend/chat/telegram.py +++ b/platypush/backend/chat/telegram.py @@ -46,7 +46,7 @@ class ChatTelegramBackend(Backend): # noinspection PyUnusedLocal def hook(update, context): msg = update.effective_message - m = re.match('\s*/([0-9a-zA-Z]+)\s*(.*)', msg.text) + m = re.match('\s*/([0-9a-zA-Z_-]+)\s*(.*)', msg.text) cmd = m.group(1).lower() args = [arg for arg in re.split('\s+', m.group(2)) if len(arg)] self.bus.post(CommandMessageEvent(chat_id=update.effective_chat.id,