From d61f9bb6e42366b6f0001568ce5a5a54e10bebb3 Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Thu, 13 Feb 2020 01:18:17 +0300 Subject: [PATCH] fix catnames with spaces --- bots/modules/ping.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bots/modules/ping.py b/bots/modules/ping.py index d753777..fe60376 100644 --- a/bots/modules/ping.py +++ b/bots/modules/ping.py @@ -38,21 +38,21 @@ class PingBotModuleConfig(TelegramBotModuleConfig): return obj def i_am_handler(self, update: Update, ctx: CallbackContext): - _, category = update.effective_message.text.split() + _, category = update.effective_message.text.split(maxsplit=1) cat = self.get_category(update, category) cat.add_user(update.effective_user.id) cat.save() update.effective_message.reply_text('Done') def i_am_not_handler(self, update: Update, ctx: CallbackContext): - _, category = update.effective_message.text.split() + _, category = update.effective_message.text.split(maxsplit=1) cat = self.get_category(update, category) cat.remove_user(update.effective_user.id) cat.save() update.effective_message.reply_text('Done') def ping_handler(self, update: Update, ctx: CallbackContext): - _, category = update.effective_message.text.split() + _, category = update.effective_message.text.split(maxsplit=1) cat = self.get_category(update, category) if not cat.user_ids: return update.effective_message.reply_text(self.no_users_text)