Nightro-Fx
Nightro-Fx
DIAdiscord.js - Imagine a boo! 👻
Created by Nightro-Fx on 11/10/2023 in #djs-questions
interaction is not defined
const { EmbedBuilder } = require('discord.js');


function errorMessage(message) {
const reply = new EmbedBuilder()
.setColor('Red')
.setDescription(message);
return interaction.reply({embeds: [reply]});
}

module.exports = errorMessage
const { EmbedBuilder } = require('discord.js');


function errorMessage(message) {
const reply = new EmbedBuilder()
.setColor('Red')
.setDescription(message);
return interaction.reply({embeds: [reply]});
}

module.exports = errorMessage
I know this sound weird/retarded but hear me out, So I am creating a message.js (kinda) for my bot where I can use this function to reply with an embed without having to define it from every single file with something like this
errorMessage('I have an error')
errorMessage('I have an error')
12 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Nightro-Fx on 10/31/2023 in #djs-questions
How to make a filter?
const filter = (interaction) => {
interaction.user.id === interaction.author.id;
return
}

const collector = reply.createMessageComponentCollector({
ComponentType: ComponentType.Button,
filter,
time: 100_000,
});
const filter = (interaction) => {
interaction.user.id === interaction.author.id;
return
}

const collector = reply.createMessageComponentCollector({
ComponentType: ComponentType.Button,
filter,
time: 100_000,
});
Error: TypeError: Cannot read properties of undefined (reading 'id') How do I get the author Id? I tried researching...
24 replies