I’m trying to write an edit message command for a bot.
I’m using a / command to edit the message providing it with the message ID and channel ID (As Get Message has fields for both).
I then follow up Get Message with Modal Reply to Interaction filling in field 1 default value with the Message Content. This doesn’t work as the Get Message doesn’t return anything.
I printed the error code out, but it’s just a bunch of random capital letters.
Not sure if I’m missing a trick with Get Message, it seems very simple. Copy the Message ID of the message I want to get.
/EDIT
Here’s a sample error code I get from Get Message: SWLJqovy
The error seems to indicate that the message could not be found, make sure that the channel and message you are inputting do actually exist and that the bot has permission to view them, eg. view channel permission
Thanks. I checked that, which is good practice I guess though it wasn’t the problem.
What I think now is the message ID that you get when using the Copy Message ID in Discord’s UI is both the Channel ID and the Message id as a single string, so I’ll need to split these up.
Testing the theory now.
it is not, the message id and channel id are two separate variables, in the future please do not mark incorrect messages as the solution as you may confuse other members who come across your post with the same issue
It is. I’m talking about the message ID you get from a Discord post.
Copying this puts a string of channel_id-message_id
into the clipboard.
So what I’ve done is add that as input to the slash command, then use split string -
to get the channel id and message id variables that I can then put into Get Message. works fine.
Copying the message ID only copies the Message ID. Copying the thread ID gives you the thread ID where as copying the Channel or Server ID gives you the ID of what you copied
Copying one does not automatically copy the other values unless you have some sort of client mod which does it for you
I do know what i am talking about, i have used inventor for a long time now and am familiar with its conventions. The channel id and message id are separate variables. In addition discord does not concatenate the channel id and message id in the copy button within forum posts. If you are experiencing this behaviour it is likely due to a client modification of some kind
Well, I think I see where the confusion comes from now. I don’t have any kind of modified Discord.
When I use the Copy Message ID on a message via the Hold Shift and click on the Copy Message ID button I get the channel_id-message_id
1130602202919088158-1287144608056217700
Now, if I instead click on the ...
icon to bring up the message drop down and click on Copy Message ID button I get just the message ID.
1287144608056217700
So are we all correct in this instance or am I still wrong?
apologies i was unaware that discord behaved in that way when using shift click on copy message id, the API (which inventor as a bot hosting platform uses) does not return that and has two separate fields that are exposed in inventor as the channel id and message id variables. I have included an example of how to use the get message block here: Inventor
1 Like