Skip to content

awaitReactions not work on ready event #4980

@samuelds

Description

@samuelds

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions