ghehusbcbrhjrjxnnxnnxnx
ghehusbcbrhjrjxnnxnnxnx
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/4/2023 in #djs-questions
TypeError: require(...).config is not a function
i remove the require(discord.js).config(); code right?
9 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/4/2023 in #djs-questions
TypeError: require(...).config is not a function
require(discord.js).config(); ^ TypeError: require(...).config is not a function
9 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/4/2023 in #djs-questions
TypeError: require(...).config is not a function
i get this typeerror error
9 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/4/2023 in #djs-questions
TypeError: require(...).config is not a function
whenever i do node .
9 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
alr
56 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
do you want me to show you my index.js?
56 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
that is the error
56 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
interactioncreate
56 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
if(!interaction.iscommand()) return
^

ReferenceError: interaction is not defined
if(!interaction.iscommand()) return
^

ReferenceError: interaction is not defined
56 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
alr
56 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
bro i did
56 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
@Danial
56 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
module.exports = {
name: "interactionCreate",
run: async (bot, interaction) => {
if (interaction.isCommand()) handleSlashCommand(bot, interaction)
else if (interaction.isButton()) handleButton(bot, interaction)
},
}

const handleButton = (bot, interaction) => {
const {client} = bot

// "name-param1-param2-...."
const [name, ...params] = interaction.customId.split("-")

const button = client.buttons.get(name)

if (!button) return
button.run(client, interaction, params)
}

const handleSlashCommand = (bot, interaction) => {
const {client} = bot
console.log('1')
if (!interaction.inGuild()) return interaction.reply("This command can only be used in a guild")

const slashcmd = client.slashcommands.get(interaction.commandName)

if (!slashcmd) return

// check permissions
if (slashcmd.perms && !interaction.member.permissions.has(slashcmd.perms))
return interaction.reply("You do not have permission to use this command")

slashcmd.run(client, interaction)
}
module.exports = {
name: "interactionCreate",
run: async (bot, interaction) => {
if (interaction.isCommand()) handleSlashCommand(bot, interaction)
else if (interaction.isButton()) handleButton(bot, interaction)
},
}

const handleButton = (bot, interaction) => {
const {client} = bot

// "name-param1-param2-...."
const [name, ...params] = interaction.customId.split("-")

const button = client.buttons.get(name)

if (!button) return
button.run(client, interaction, params)
}

const handleSlashCommand = (bot, interaction) => {
const {client} = bot
console.log('1')
if (!interaction.inGuild()) return interaction.reply("This command can only be used in a guild")

const slashcmd = client.slashcommands.get(interaction.commandName)

if (!slashcmd) return

// check permissions
if (slashcmd.perms && !interaction.member.permissions.has(slashcmd.perms))
return interaction.reply("You do not have permission to use this command")

slashcmd.run(client, interaction)
}
56 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
here is the code
56 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
56 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
alright
56 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
you want the code?
56 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
wdym
56 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
it says ReferenceError: interaction is not defined
56 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ghehusbcbrhjrjxnnxnnxnx on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
with my bot
56 replies