Skip to content

Commit

Permalink
Handle not specified username in /reserve command
Browse files Browse the repository at this point in the history
  • Loading branch information
mhbahmani committed Oct 9, 2023
1 parent 84d74ed commit f573432
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ async def automatic_reserve_food(self, update, context):
username = None
if len(splited_text) == 2:
username = splited_text[-1]
elif len(splited_text) < 2:
await context.bot.send_message(
chat_id=update.effective_chat.id,
text=messages.no_username_specified_error_message)
return
try:
user_id = self.db.get_user_id_by_username(username)
except AttributeError as e:
Expand Down

0 comments on commit f573432

Please sign in to comment.