You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a method that listens to on-message and I want to get the *current-message* ID so that I can pass it to reply as reply-message-id, but *current-message* is not an exported symbol. Is that something we can export? Or maybe pass an instance of the message class to on-message? Or any other suggestions?
The text was updated successfully, but these errors were encountered:
Thanks for your quick response! With reply if I want to pass the reply-to-message-id parameter, I can't because I don't have the message ID. And I need a message ID to send a message via cl-telegram-bot/message:send-message too. My use case is simple, I want to quote the user's original text when replying to it.
For example, in the below snippet I want to have the value of some-imaginary-id which is the ID of the message that has the text text.
(defmethod cl-telegram-bot:on-message ((cl-telegram-bot/bot:bot bot) text)
(reply text :reply-to-message-id some-imaginary-id))
Ideally, it would be great if the message is passed along like this:
(defgeneric on-message (bot message)
(:documentation "This method gets called with the message.
By default it does nothing."))
Rather than
(defgeneric on-message (bot text)
(:documentation "This method gets called with raw text from the message.
By default it does nothing."))
This would allow us to access all the slots of the message object, not just its id.
bmansurov
changed the title
How get message ID when replying to a message?
How to get message ID when replying to a message?
Jun 6, 2023
I have a method that listens to
on-message
and I want to get the*current-message*
ID so that I can pass it toreply
asreply-message-id
, but*current-message*
is not an exported symbol. Is that something we can export? Or maybe pass an instance of themessage
class toon-message
? Or any other suggestions?The text was updated successfully, but these errors were encountered: