-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Description
Please describe the problem you are having in as much detail as possible:
awaitReactions not work on ready event, the same code works with message event. Not error print on console.
Include a reproducible code sample here, if possible:
const config = require('./configs/global.json');
const client = new Discord.Client();
client.on('ready', async function() {
const server = await client.guilds.fetch("guildsID");
const channel = await server.channels.resolve("channelID");
let message = await channel.send("test");
await message.react('✅');
message.awaitReactions(function(reaction, user) {
console.log("ok");
return true;
}).catch(function(collected) {
message.channel.send('Error with reaction detection');
});
});
client.login("TOKEN");const config = require('./configs/global.json');
const client = new Discord.Client();
client.on('message', async function(message) {
if(!message.content == "go") return;
const server = await client.guilds.fetch("guildsID");
const channel = await server.channels.resolve("channelID");
let message = await channel.send("test");
await message.react('✅');
message.awaitReactions(function(reaction, user) {
console.log("ok");
return true;
}).catch(function(collected) {
message.channel.send('Error with reaction detection');
});
});
client.login("TOKEN");Further details:
- discord.js version: ^12.4.1
- Node.js version: v12.19.0
- Operating system: Windows 10
- Priority this issue should have – please be realistic and elaborate if possible:
Relevant client options:
- partials: none
- gateway intents: none
- other: none
- I have also tested the issue on latest master, commit hash:
Metadata
Metadata
Assignees
Labels
No labels