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 c2eaaf2 commit 1a79966
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion bot/handlers/comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ def comment(update: Update, context: CallbackContext) -> None:
if not update.message or not update.message.reply_to_message:
return None

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

if COMMENT_EMOJI_RE.match(reply_text_start):
return reply_to_comment(update, context)
Expand Down
6 changes: 5 additions & 1 deletion bot/handlers/upvotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ def upvote(update: Update, context: CallbackContext) -> None:
if not user:
return None

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

if COMMENT_EMOJI_RE.match(reply_text_start):
comment = get_club_comment(update)
Expand Down
4 changes: 2 additions & 2 deletions bot/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def private_message(update: Update, context: CallbackContext) -> None:
)
else:
update.effective_chat.send_message(
"Йо! Полный список моих команд покажет /help, "
"а еще мне можно отвечать на посты и уведомления, всё это будет поститься прямо в Клуб!",
"Не понял. Полный список моих команд покажет /help, "
"а еще через меня можно отвечать на посты и комментарии и всё это будет поститься прямо в Клуб!",
parse_mode=ParseMode.HTML
)

Expand Down

0 comments on commit 1a79966

Please sign in to comment.