diff --git a/apps/telegram-bot/commands.py b/apps/telegram-bot/commands.py index ae66faa..609a921 100644 --- a/apps/telegram-bot/commands.py +++ b/apps/telegram-bot/commands.py @@ -229,13 +229,20 @@ async def cmd_add(update: Update, ctx: ContextTypes.DEFAULT_TYPE) -> None: user_id = get_user_id(update) room_id = get_room_id(update) - bounty = BOUNTY_SERVICE.add_bounty( - room_id=room_id, - user_id=user_id, - text=text, - link=link, - due_date_ts=due_date_ts, - ) + try: + bounty = BOUNTY_SERVICE.add_bounty( + room_id=room_id, + user_id=user_id, + text=text, + link=link, + due_date_ts=due_date_ts, + ) + except PermissionError as e: + await update.message.reply_text(f"⛔ {e}") + return + except ValueError as e: + await update.message.reply_text(f"⛔ {e}") + return due_str = "" if due_date_ts: