Skip to content

Commit

Permalink
fix: ah sooo
Browse files Browse the repository at this point in the history
  • Loading branch information
vas3k committed Nov 13, 2024
1 parent 2773141 commit fc2b88c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bot/handlers/comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


def comment(update: Update, context: CallbackContext) -> None:
log.info("Comment handler triggered: %s", update)
log.info("Comment handler triggered")

if not update.message or not update.message.reply_to_message:
log.info("No message or reply_to_message in update. Skipping.")
Expand Down
6 changes: 4 additions & 2 deletions bot/handlers/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ def get_club_user(update: Update):


def get_club_comment(update: Update) -> Optional[Comment]:
entities = update.message.reply_to_message.entities or update.message.reply_to_message.caption_entities or []
url_entities = [
entity["url"] for entity in update.message.reply_to_message.entities if entity["type"] == "text_link"
entity["url"] for entity in entities if entity["type"] == "text_link"
]

for url_entity in url_entities:
Expand All @@ -96,8 +97,9 @@ def get_club_comment(update: Update) -> Optional[Comment]:


def get_club_post(update: Update) -> Optional[Post]:
entities = update.message.reply_to_message.entities or update.message.reply_to_message.caption_entities or []
url_entities = [
entity["url"] for entity in update.message.reply_to_message.entities if entity["type"] == "text_link"
entity["url"] for entity in entities if entity["type"] == "text_link"
]

for url_entity in url_entities:
Expand Down

0 comments on commit fc2b88c

Please sign in to comment.