Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

messageReaction.me does not work propery #7377

Closed
WilsontheWolf opened this issue Jan 31, 2022 · 1 comment · Fixed by #7378
Closed

messageReaction.me does not work propery #7377

WilsontheWolf opened this issue Jan 31, 2022 · 1 comment · Fixed by #7378

Comments

@WilsontheWolf
Copy link
Contributor

Which package is this bug report for?

discord.js

Issue description

Reacting to a message then checking messageReaction.me no longer works. This regression appears to have happened on discord.js v13.2.0.

Code sample

import { Client, Intents } from "discord.js";
import 'dotenv/config';

const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MESSAGE_REACTIONS]});

client.on('messageReactionAdd', async (messageReaction) => {
    console.log(messageReaction.emoji.name, messageReaction.me, messageReaction.users.cache.has(client.user.id))
    if (!messageReaction.me) {
        await messageReaction.message.react(messageReaction.emoji);
    }
});

client.login(process.env.TOKEN);

// This logs 
sand false false
sand false true
// but should log (and logs on 13.1.0 and lower) 
sand false false
sand true true

Package version

13.6.0 but any vesion past 13.2.0 works

Node.js version

v16.13.1

Operating system

Arch Linux

Priority this issue should have

Medium (should be fixed soon)

Which partials do you have configured?

No Partials

Which gateway intents are you subscribing to?

Guilds, GuildMessages, GuildMessageReactions

I have tested this issue on a development release

No. Something's changed with intents and I can't be bothered to figure it out.

@WilsontheWolf
Copy link
Contributor Author

This appears to have been changed in this commit 00bd92a#diff-51328030b2c172c9836196634600854b6172d680dcd533268008eb1737a82f02L123-R123. Previously, if it was false it would be overwritten by the cache but now it only does if its null.

@kyranet kyranet added has PR and removed need repro labels Feb 1, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants