Skip to content

Commit

Permalink
use quotedMessageId instead of quoted_message_id
Browse files Browse the repository at this point in the history
  • Loading branch information
adbenitez committed Feb 5, 2024
1 parent 5d37788 commit 21db8be
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions faqbot/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def _remove(bot: Bot, accid: int, event: AttrDict) -> None:
faq = (session.execute(stmt)).scalars().first()
if faq:
session.delete(faq)
reply = {"text": "✅ Note removed", "quoted_message_id": msg.id}
reply = {"text": "✅ Note removed", "quotedMessageId": msg.id}
bot.rpc.send_msg(accid, msg.chat_id, reply)


Expand All @@ -114,7 +114,7 @@ def _save(bot: Bot, accid: int, event: AttrDict) -> None:
if question.startswith(const.COMMAND_PREFIX):
reply = {
"text": f"Invalid text, can not start with {const.COMMAND_PREFIX}",
"quoted_message_id": msg.id,
"quotedMessageId": msg.id,
}
bot.rpc.send_msg(accid, msg.chat_id, reply)
return
Expand All @@ -139,12 +139,12 @@ def _save(bot: Bot, accid: int, event: AttrDict) -> None:
answer_viewtype=quote.view_type,
)
)
reply = {"text": "✅ Saved", "quoted_message_id": msg.id}
reply = {"text": "✅ Saved", "quotedMessageId": msg.id}
except IntegrityError:
reply = {
"text": "❌ Error: there is already a saved reply for that tag/question,"
" use /remove first to remove the old reply",
"quoted_message_id": msg.id,
"quotedMessageId": msg.id,
}
bot.rpc.send_msg(accid, msg.chat_id, reply)

Expand All @@ -166,7 +166,7 @@ def _answer(bot: Bot, accid: int, event: AttrDict) -> None:
quoted_msg_id = msg.quote.message_id if msg.quote else msg.id
reply = {
"text": get_answer_text(bot, accid, faq, msg, session),
"quoted_message_id": quoted_msg_id,
"quotedMessageId": quoted_msg_id,
}
if faq.answer_file:
with TemporaryDirectory() as tmp_dir:
Expand All @@ -183,7 +183,7 @@ def reply_to_command_in_dm(bot: Bot, accid: int, msg: AttrDict) -> bool:
if chat.chat_type == const.ChatType.SINGLE:
reply = {
"text": "Can't save notes in private, add me to a group and use the command there",
"quoted_message_id": msg.id,
"quotedMessageId": msg.id,
}
bot.rpc.send_msg(accid, msg.chat_id, reply)
return True
Expand Down

0 comments on commit 21db8be

Please sign in to comment.