messageCreate not picking up dm messages

My bot's messageReact event doesn't pick up any messages that are in dms, even tho i have enabled the needed intents for them, it works fine for guild messages tho bot.ts
import { Client, Collection } from "discord.js";
import { Command } from "./interfaces/command.js";
import { Handler } from "./interfaces/handlers.js";
import { QuickDB } from "quick.db";

export interface Ticket {
userId: string;
channelId: string;
}

export interface Bot {
client: Client;
commands: Collection<string, Command>;
handlers: Collection<string, Handler>;
tickets: QuickDB<Ticket>;
}

export const bot: Bot = {
client: new Client({
intents: [
"Guilds",
"GuildMembers",
"DirectMessages",
"GuildBans",
"GuildMessages",
"MessageContent",
],
}),
commands: new Collection(),
handlers: new Collection(),
tickets: new QuickDB().table<Ticket>("tickets"),
};
import { Client, Collection } from "discord.js";
import { Command } from "./interfaces/command.js";
import { Handler } from "./interfaces/handlers.js";
import { QuickDB } from "quick.db";

export interface Ticket {
userId: string;
channelId: string;
}

export interface Bot {
client: Client;
commands: Collection<string, Command>;
handlers: Collection<string, Handler>;
tickets: QuickDB<Ticket>;
}

export const bot: Bot = {
client: new Client({
intents: [
"Guilds",
"GuildMembers",
"DirectMessages",
"GuildBans",
"GuildMessages",
"MessageContent",
],
}),
commands: new Collection(),
handlers: new Collection(),
tickets: new QuickDB().table<Ticket>("tickets"),
};
index.ts
import { bot } from "./bot.js";
import { config } from "./config.js";
import { importDirectory } from "./utils/loader.js";

await importDirectory("./dist/commands");

await importDirectory("./dist/events");

await importDirectory("./dist/handlers");

const rest = new REST({ version: "10" }).setToken(config.token);

try {
console.log("Started refreshing application (/) commands.");

await rest.put(Routes.applicationCommands(atob(config.token.split(".")[0])), {
body: bot.commands.map((e) => e.data),
});

console.log("Successfully reloaded application (/) commands.");
} catch (error) {
console.error(error);
}

await bot.client.login(config.token);
import { bot } from "./bot.js";
import { config } from "./config.js";
import { importDirectory } from "./utils/loader.js";

await importDirectory("./dist/commands");

await importDirectory("./dist/events");

await importDirectory("./dist/handlers");

const rest = new REST({ version: "10" }).setToken(config.token);

try {
console.log("Started refreshing application (/) commands.");

await rest.put(Routes.applicationCommands(atob(config.token.split(".")[0])), {
body: bot.commands.map((e) => e.data),
});

console.log("Successfully reloaded application (/) commands.");
} catch (error) {
console.error(error);
}

await bot.client.login(config.token);
6 Replies
d.js toolkit
d.js toolkit5mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
lonely dev
lonely devOP5mo ago
No description
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
lonely dev
lonely devOP5mo ago
not really its there
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
lonely dev
lonely devOP5mo ago
i didnt know that was necessary, im gonna try it alright thanks that worked
Want results from more Discord servers?
Add your server