glitchdetected1
glitchdetected1
DIdiscord.js - Imagine ❄
Created by glitchdetected1 on 1/2/2025 in #djs-questions
Object literal may only specify known properties, and 'dynamic' does not exist in type 'ImageURLOpti
ok
8 replies
DIdiscord.js - Imagine ❄
Created by glitchdetected1 on 1/2/2025 in #djs-questions
Object literal may only specify known properties, and 'dynamic' does not exist in type 'ImageURLOpti
"discord.js": "^14.17.2",
8 replies
DIdiscord.js - Imagine ❄
Created by glitchdetected1 on 1/2/2025 in #djs-questions
Object literal may only specify known properties, and 'dynamic' does not exist in type 'ImageURLOpti
Object literal may only specify known properties, and 'dynamic' does not exist in type 'ImageURLOptions'.
8 replies
DIdiscord.js - Imagine ❄
Created by glitchdetected1 on 1/2/2025 in #djs-questions
Property 'getUser' does not exist on type 'Omit<CommandInteractionOptionResolver<CacheType>
const user = interaction.options.getUser('target') || interaction.user;
const member = await interaction.guild.members.fetch(user.id);
const user = interaction.options.getUser('target') || interaction.user;
const member = await interaction.guild.members.fetch(user.id);
6 replies
DIdiscord.js - Imagine ❄
Created by glitchdetected1 on 1/2/2025 in #djs-questions
Property 'getUser' does not exist on type 'Omit<CommandInteractionOptionResolver<CacheType>
"discord.js": "^14.17.2",
6 replies
DIdiscord.js - Imagine ❄
Created by Exiler Valkyr on 1/2/2025 in #djs-questions
how can i make my bot online forever
thats what i do for my bot
8 replies
DIdiscord.js - Imagine ❄
Created by Exiler Valkyr on 1/2/2025 in #djs-questions
how can i make my bot online forever
hosting it on a home server with ubuntu server
8 replies
DIdiscord.js - Imagine ❄
Created by glitchdetected1 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
DIdiscord.js - Imagine ❄
Created by glitchdetected1 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
DIdiscord.js - Imagine ❄
Created by glitchdetected1 on 7/4/2023 in #djs-questions
TypeError: require(...).config is not a function
i get this typeerror error
9 replies
DIdiscord.js - Imagine ❄
Created by glitchdetected1 on 7/4/2023 in #djs-questions
TypeError: require(...).config is not a function
whenever i do node .
9 replies
DIdiscord.js - Imagine ❄
Created by glitchdetected1 on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
alr
56 replies
DIdiscord.js - Imagine ❄
Created by glitchdetected1 on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
do you want me to show you my index.js?
56 replies
DIdiscord.js - Imagine ❄
Created by glitchdetected1 on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
that is the error
56 replies
DIdiscord.js - Imagine ❄
Created by glitchdetected1 on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
interactioncreate
56 replies
DIdiscord.js - Imagine ❄
Created by glitchdetected1 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
DIdiscord.js - Imagine ❄
Created by glitchdetected1 on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
alr
56 replies
DIdiscord.js - Imagine ❄
Created by glitchdetected1 on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
bro i did
56 replies
DIdiscord.js - Imagine ❄
Created by glitchdetected1 on 7/2/2023 in #djs-questions
ReferenceError: interaction is not defined
@Danial
56 replies
DIdiscord.js - Imagine ❄
Created by glitchdetected1 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