discord-api-docs icon indicating copy to clipboard operation
discord-api-docs copied to clipboard

Documentation does not specify `GUILDS` intent requirement when using `DIRECT_MESSAGE_REACTIONS`

Open SpencerKaiser opened this issue 11 months ago • 1 comments

Description

Reading through the documentation associated with intents there is zero mention of the GUILDS intent being a requirement to use DIRECT_MESSAGE_REACTIONS

Steps to Reproduce

Create a tiny repro with these code. Without the GatewayIntentBits.Guilds intent, your handler will never fire

import { Client, Events, GatewayIntentBits, Partials } from "discord.js";
import { ENV } from "./env";

const { discordToken } = ENV;

const client = new Client({
  intents: [
    GatewayIntentBits.Guilds, // WHY IS THIS NECESSARY?!?!?!
    GatewayIntentBits.GuildMessageReactions
  ],
  partials: [
    Partials.Reaction,
    Partials.Message,
    Partials.Channel,
    Partials.GuildMember,
    Partials.User,
  ],
});

client.once(Events.ClientReady, (readyClient) => {
  console.log(`Ready! Logged in as ${readyClient.user.tag}`);
});

client.on(Events.MessageReactionAdd, () => {
  console.log('Reaction added');
});

void client.login(discordToken);

Expected Behavior

Documentation would specify the reason the GUILDS intent is needed OR the intent would not be needed

Current Behavior

Intent is needed and nothing anywhere in the docs specifies why

Screenshots/Videos

No response

Client and System Information

macOS 14.2.1 (23C71) discord.js 14.17.2 node v20.18.1

SpencerKaiser avatar Feb 13 '25 03:02 SpencerKaiser

You specified GuildMessageReactions in your code.

Droid00000 avatar Feb 13 '25 17:02 Droid00000