Responses to messages
3 things I'd like to:
1. Check if the message is a response
2. Get the message this message responds to
3. (Optionally) get the same but from a message that is a response to a
MessageContextMenuCommand
65 Replies
I have tried to search for interfaces to cast to, but no result...
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
https://dokka.kord.dev/core/dev.kord.core.entity/-message/referenced-message.html That might be what you are looking for
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
ig
not sure either tbh
Yeah š
Thanks!
This is exactly what I wanted for the first two, what about the
MessageContextMenuCommand
? Is it even possible?That should give you the same Message Object
Tried it, but the
referencedMessage
property was null šUnknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
Haven't worked with rest yet š, but will try it!
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
Doesn't work with rest either, it's not taken as a reply imo.
Also, good to mention, the response was ephemeral
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
ofc
Response for message context-menu command:
report-confirm
button
Tell me if something in the code could be improved, I'm new to Kotlin (coming from Java š¤¢)Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
What's the issue? interaction interaction data from the message data, but can't figure out how š
Message#referencedMessage
is always null
when getting it from a message that is a response to message context-menu command interaction.
I think I should be able to get the Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
Won't work either š
Gotta try with rest in a second
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
ā¬ļø
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
Yea, I have it enabled
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
Yeah
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
Nope, gotta do it in a sec, if you'd like to see more of my code, I can show you ofc
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
Error:
line
27
of ReportConfirmButton
:
If you'd like the deepest logging level or a video, tell me
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
results with both
messageReference
and referencedMessage
missingUnknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
I'm not replying to a message? I'm trying to get the message a message context menu action was used on
Bottom is the response for context menu action used on the top one
And I'm trying to access the content of the top one from an interaction on the button from the bottom one
(The bottom one is now public, so there won't be any problems with ephemeral if there could be)
That number is hunting me XD
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
well, yeah
ā¬ļø
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
Heh? š
I'm responding to button interaction with a new message
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
No in my opinion
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
wait a sec
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
@Deleted User
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
If it won't be possible, I think I have an easy workaround
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
yeah
but the first response should be ephemeral, while the second public (if it's even possible)
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
Message#interaction
doesn't return an instance of Interaction
, but Message.Interaction
š«¤
I've already tried using that šUnknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
np
Discovered anything?
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
yea
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
Yzp, works well now
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
The only bad about this is that that the entries will be stored until cleaned up if the user won't confirm it, right?
As if it's not possible to get the message directly from the interactions, I'll most likely store the message already in the first embed š
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View