From f400c6eee7dc510b29a0700870b2efe5f0823648 Mon Sep 17 00:00:00 2001 From: Yariv Menachem Date: Mon, 6 Jan 2025 15:51:17 +0200 Subject: [PATCH] add strip for cites --- src/telegram_handler/telegram_start_handler.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/telegram_handler/telegram_start_handler.py b/src/telegram_handler/telegram_start_handler.py index d30c643..a6426f6 100644 --- a/src/telegram_handler/telegram_start_handler.py +++ b/src/telegram_handler/telegram_start_handler.py @@ -79,6 +79,8 @@ class TelegramStartHandler: async def address(self, update: Update, context: ContextTypes.DEFAULT_TYPE) -> int: """Asks for a location.""" cities = update.message.text.split(",") + # Remove leading/trailing spaces from each city name + cities = [city.strip() for city in cities] await update.message.set_reaction(ReactionEmoji.FIRE) reply_markup = ReplyKeyboardMarkup([[KeyboardButton("Yes"), KeyboardButton("No")]], one_time_keyboard=True, input_field_placeholder=Flow.VERIFY_ADDRESS.name)