From ad7d8c414617a4e0ebc796c84e7c6575ab2fdb8a Mon Sep 17 00:00:00 2001 From: Florian Kellermann Date: Fri, 6 May 2022 22:26:37 +0200 Subject: [PATCH] Small pep8 changes --- source/bot.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/bot.py b/source/bot.py index 4613104..43cd6fc 100644 --- a/source/bot.py +++ b/source/bot.py @@ -62,9 +62,8 @@ def start_name_setter(message): if not re.match(r'^[a-zA-Z][a-zA-Z0-9_]+$', str(message.text)): bot.reply_to(message, "Name has to be alphanumeric (including underscores) and start with a letter") return - - else: - user_name = str(message.text) + + user_name = str(message.text) try: user = User(telegram_id=user_id, username=user_name, admin=False) @@ -291,6 +290,11 @@ def add_product(message): def receive_product_data(message): + """ registering new product in the db and fetching it from amazon + + Args: + message (Message): Message that is being reacted to. Always from add_product because of next_step_handler + """ # TODO: Check if user is admin user_id = int(message.from_user.id) product_id = str(message.text)