Basgamer999
Basgamer999
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 6/24/2023 in #djs-questions
get a unknown webhook error.
LIke this?
const message = await interaction.reply({
components: [buttons],
embeds: [embed],
files: [gameboardImage],
fetchReply: true
});
const message = await interaction.reply({
components: [buttons],
embeds: [embed],
files: [gameboardImage],
fetchReply: true
});
15 replies
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 6/24/2023 in #djs-questions
get a unknown webhook error.
15 replies
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 6/24/2023 in #djs-questions
get a unknown webhook error.
Alright should do
15 replies
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 6/24/2023 in #djs-questions
get a unknown webhook error.
so change this interaction.member.id to a variable userID?
15 replies
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 6/24/2023 in #djs-questions
get a unknown webhook error.
So i should change everything that uses interaction. something to store in a other variable and that should fix it?
15 replies
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 6/24/2023 in #djs-questions
get a unknown webhook error.
[email protected] node:v18.16.0.
15 replies
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 1/11/2023 in #djs-questions
Commands dont get executed somehow
yep now it works thank you ❤️
12 replies
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 1/11/2023 in #djs-questions
Commands dont get executed somehow
that makes sense thanks
12 replies
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 1/11/2023 in #djs-questions
Commands dont get executed somehow
o i might have deleted that oops
12 replies
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 1/11/2023 in #djs-questions
Commands dont get executed somehow
thats the only part that handles commands the other files are responsible for other parts to work
const fs = require("fs");

module.exports = (client) => {
client.handleEvents = async () => {
const eventFolders = fs.readdirSync(`./src/events`);
for (const folder of eventFolders) {
const eventFiles = fs
.readdirSync(`./src/events/${folder}`)
.filter((file) => file.endsWith("js"));
switch (folder) {
case "client":
for (const file of eventFiles) {
const event = require(`../../events/${folder}/${file}`);
if (event.once) client.once(event.name, (...args) => event.execute(...args, client))
else client.on(event.name, (...args) => event.execute(...args, client));
}
break;

default:
break;
}
}
};
};
const fs = require("fs");

module.exports = (client) => {
client.handleEvents = async () => {
const eventFolders = fs.readdirSync(`./src/events`);
for (const folder of eventFolders) {
const eventFiles = fs
.readdirSync(`./src/events/${folder}`)
.filter((file) => file.endsWith("js"));
switch (folder) {
case "client":
for (const file of eventFiles) {
const event = require(`../../events/${folder}/${file}`);
if (event.once) client.once(event.name, (...args) => event.execute(...args, client))
else client.on(event.name, (...args) => event.execute(...args, client));
}
break;

default:
break;
}
}
};
};
like this one for my events
12 replies
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 1/11/2023 in #djs-questions
Commands dont get executed somehow
*14.7.1 node:18.13.0 *no errors that makes it wierd
const { REST } = require('@discordjs/rest')
const { Routes } = require('discord-api-types/v10')
const fs = require("fs");

module.exports = (client) => {
client.handleCommands = async () => {
const commandFolders = fs.readdirSync("./src/commands");
for (const folder of commandFolders) {
const commandFiles = fs
.readdirSync(`./src/commands/${folder}`)
.filter((file) => file.endsWith(".js"));

const { commands, commandArray } = client;
for (const file of commandFiles) {
const command = require(`../../commands/${folder}/${file}`);
commands.set(command.data.name, command);
commandArray.push(command.data.toJSON());
}
}

const clientId = '1062792579780976740';
const guildId = '1062791717054591057';
const rest = new REST({ version: '9' }).setToken(process.env.token)
try {
console.log('started refreshing application (/) commands');

await rest.put(Routes.applicationGuildCommands(clientId,guildId), {
body: client.commandArray,
});

console.log('All slash commands have been registered without errors')
} catch (error) {
console.error(error)
}
};
};
const { REST } = require('@discordjs/rest')
const { Routes } = require('discord-api-types/v10')
const fs = require("fs");

module.exports = (client) => {
client.handleCommands = async () => {
const commandFolders = fs.readdirSync("./src/commands");
for (const folder of commandFolders) {
const commandFiles = fs
.readdirSync(`./src/commands/${folder}`)
.filter((file) => file.endsWith(".js"));

const { commands, commandArray } = client;
for (const file of commandFiles) {
const command = require(`../../commands/${folder}/${file}`);
commands.set(command.data.name, command);
commandArray.push(command.data.toJSON());
}
}

const clientId = '1062792579780976740';
const guildId = '1062791717054591057';
const rest = new REST({ version: '9' }).setToken(process.env.token)
try {
console.log('started refreshing application (/) commands');

await rest.put(Routes.applicationGuildCommands(clientId,guildId), {
body: client.commandArray,
});

console.log('All slash commands have been registered without errors')
} catch (error) {
console.error(error)
}
};
};
handle command file * The commands get registered but not executed
12 replies
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 10/18/2022 in #djs-questions
Responding to chooses
I wasn’t able to find it on that discord.ja guide
7 replies
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 10/18/2022 in #djs-questions
Responding to chooses
Thx!
7 replies
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 10/18/2022 in #djs-questions
Responding to chooses
*14.5.0 *value is a not definidied. *
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('faq')
.setDescription('Shows faq questions')
.addStringOption(option =>
option.setName('category')
.setDescription('The gif category')
.setRequired(true)
.addChoices(
{ name: '1', value: '1' },
{ name: '2', value: '2' },
{ name: '3', value: '3' },
)),
async execute(interaction) {
await interaction.reply(value);
},
};
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('faq')
.setDescription('Shows faq questions')
.addStringOption(option =>
option.setName('category')
.setDescription('The gif category')
.setRequired(true)
.addChoices(
{ name: '1', value: '1' },
{ name: '2', value: '2' },
{ name: '3', value: '3' },
)),
async execute(interaction) {
await interaction.reply(value);
},
};
*this was my idea but it isnt working. i thought maybe value showed me what it was
7 replies
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 10/12/2022 in #djs-questions
uptime command
thx. How would i decode this to human readable time?
17 replies
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 10/12/2022 in #djs-questions
uptime command
o oops
17 replies
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 10/12/2022 in #djs-questions
uptime command
or do i need to put it somewhere else then after execute?
17 replies
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 10/12/2022 in #djs-questions
uptime command
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('uptime')
.setDescription('Showing the uptime of the bot'),
async execute(interaction) {
let uptime = interaction.client.uptime()
await interaction.reply(uptime);
},
};
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('uptime')
.setDescription('Showing the uptime of the bot'),
async execute(interaction) {
let uptime = interaction.client.uptime()
await interaction.reply(uptime);
},
};
I tried that but its still not working
17 replies
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 10/12/2022 in #djs-questions
uptime command
thx
17 replies
DIAdiscord.js - Imagine an app
Created by Basgamer999 on 10/12/2022 in #djs-questions
uptime command
Huh? I am new to discord bot coding in JS. Any examples somewhere?
17 replies