Skip to content

Commit

Permalink
fix: bot replies to pictures
Browse files Browse the repository at this point in the history
  • Loading branch information
vas3k committed Nov 13, 2024
1 parent e90e1e1 commit 4c7f5c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions bot/handlers/comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
def comment(update: Update, context: CallbackContext) -> None:
if not update.message \
or not update.message.reply_to_message \
or not update.message.reply_to_message.text:
or not update.message.reply_to_message.text \
or not update.message.reply_to_message.caption:
return None

reply_text_start = update.message.reply_to_message.text[:10]
reply_text_start = (update.message.reply_to_message.text or update.message.reply_to_message.caption)[:10]

if COMMENT_EMOJI_RE.match(reply_text_start):
return reply_to_comment(update, context)
Expand Down
5 changes: 3 additions & 2 deletions bot/handlers/upvotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
def upvote(update: Update, context: CallbackContext) -> None:
if not update.message \
or not update.message.reply_to_message \
or not update.message.reply_to_message.text:
or not update.message.reply_to_message.text \
or not update.message.reply_to_message.caption:
return None

user = get_club_user(update)
if not user:
return None

reply_text_start = update.message.reply_to_message.text[:10]
reply_text_start = (update.message.reply_to_message.text or update.message.reply_to_message.caption)[:10]

if COMMENT_EMOJI_RE.match(reply_text_start):
comment = get_club_comment(update)
Expand Down

0 comments on commit 4c7f5c0

Please sign in to comment.