Answer the question
In order to leave comments, you need to log in
How to read reaction to old discord message?
Hello, I'm interested in the question of how to read the setting of the reaction to the old message? That is, if the user put a certain reaction in the messages "32135456546", then the bot reacts to it.
My bot reacts perfectly to new messages with a reaction, but after restarting the bot does not see the old messages and new reactions to them
robot.on('messageReactionAdd', async (reaction, user) => {
if (reaction.message.partial) await reaction.message.fetch();
if (reaction.partial) await reaction.fetch();
if (user.bot) return;
if (!reaction.message.guild) return;
console.log(`${user.tag} поставил реакцию ${reaction.emoji.name} на сообщении ${reaction.message.id}.`);
if (client.channels.cache.get === "905864030718156882") {
}
});
Answer the question
In order to leave comments, you need to log in
Hey, you need to fetch these messages.
If these are specific messages, let's say getting roles by reaction, then you can do this:
robot.channels.cache.get('айди канала').messages.fetch('айди сообщения')
robot.channels.cache.forEach((channel)=>{
channel.messages.fetch({ limit: 1000 })
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question