sbot50
sbot50
DIAdiscord.js - Imagine a boo! 👻
Created by sbot50 on 6/21/2024 in #djs-questions
Message interaction is null
I found out that im an idiot, i recoded it wrong and it summons a new msg. I'll mark this as closed
5 replies
DIAdiscord.js - Imagine a boo! 👻
Created by sbot50 on 6/21/2024 in #djs-questions
Message interaction is null
I dont see how most of this is relevant but ok Node version: v22.3.0 DiscordJS version: 14.15.3 Might be a dc api issue, seeing as theyre moving to inteaction_metadata or smth Code:
const guild = await this.client.guilds.cache.get(interaction.guildId);
const channel = await guild.channels.cache.get(interaction.channelId);
const msg = await channel.messages.fetch(interaction.message.id);
console.log(interaction.message);
console.log(msg);
const guild = await this.client.guilds.cache.get(interaction.guildId);
const channel = await guild.channels.cache.get(interaction.channelId);
const msg = await channel.messages.fetch(interaction.message.id);
console.log(interaction.message);
console.log(msg);
The stack trace really isnt needed, it just that in the logs the value of interaction for the msg object is null unless its the first button press.
5 replies