I am doing a report system for a discord bot and I want the player to report a specific message by the id so that the moderators can decide if it is offensive or not. I am struggling to find a way to get the message's text from the given id. Is there a possible way of doing this?
How do I find a discord message using ID? Add a search option in the search bar with the name: “ID”. This feature would allow user's who cannot code bots, or don't have bots that can fetch messages to find specific messages with IDs. If no message is found an error can be returned, etc.
If you want to export Discord chat messages, you won't find any built-in feature to do so. If you want to download your messages, you'll need to select, copy, and paste the messages manually, or use a tool like DiscordChatExporter to do it for you.
To get a Channel ID right click the channel and click on "Copy ID" then paste it into your Discord or on a text editor. Alternatively type the channel as a mention and place a backslash \ in front of the mention. It should look like this <#475182341782896651> and the number is the ID.
fetchMessage
is no longer present in Discord.js starting in version 12, but you can use the fetch
method of the MessageManager
class from the messages
property of the TextChannel
class.
msg.channel.messages.fetch("701574160211771462")
.then(message => console.log(message.content))
.catch(console.error);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With