Ichinose102
Ichinose102
DIAdiscord.js - Imagine an app
Created by Ichinose102 on 10/8/2023 in #djs-questions
Slash
Well I didn’t have config.json before
29 replies
DIAdiscord.js - Imagine an app
Created by Ichinose102 on 10/8/2023 in #djs-questions
Slash
this part
29 replies
DIAdiscord.js - Imagine an app
Created by Ichinose102 on 10/8/2023 in #djs-questions
Slash
I’m sorry but I’m really struggling to Thonk
29 replies
DIAdiscord.js - Imagine an app
Created by Ichinose102 on 10/8/2023 in #djs-questions
Slash
thanks
29 replies
DIAdiscord.js - Imagine an app
Created by Ichinose102 on 10/8/2023 in #djs-questions
Slash
XD simple and effective
29 replies
DIAdiscord.js - Imagine an app
Created by Ichinose102 on 10/8/2023 in #djs-questions
Slash
const Discord = require('discord.js') const { REST } = require("@discordjs/rest") const { Routes } = require('discord.js') module.exports = async bot => { let commands = []; bot.commands.forEach(async command => { let slashcommand = new Discord.SlashCommandBuilder() .setName(command.name) .setDescription(command.description) .setDMPermission(command.dm) .setDefaultMemberPermissions(command.permissions === "Aucune" ? null : command.permissions) if (command.options?.length >= 1) { for (let i = 0; i < command.options.length; i++) { slashcommand[add${command.options[i].type.slice(0, 1).ToUpperCase() + command.options[i].type.slice(1, command.options[i].type.length)}Option](option => option.setName(command.options[i].name).setDescription(command.options[i].description).setRequired(command.options[i].required)) } } commands.push(slashcommand); }) const rest = new Discord.REST({ version: "10" }).setToken(bot.token) await rest.put(Routes.applicationCommands(bot.user.id), { body: commands }) console.log("Les commandes sont prêtes"); }
29 replies
DIAdiscord.js - Imagine an app
Created by Ichinose102 on 10/8/2023 in #djs-questions
Slash
Does that mean I have to replace it with something else?
29 replies
DIAdiscord.js - Imagine an app
Created by Ichinose102 on 10/8/2023 in #djs-questions
Slash
I can not see the problem ToUpperCase in my code
29 replies
DIAdiscord.js - Imagine an app
Created by Ichinose102 on 10/8/2023 in #djs-questions
Slash
Hello, I need a little help because I have an error in the slashcommands. Here is the error: slashcommand[add${command.options[i].type.slice(0, 1).ToUpperCase() + command.options[i].type.slice(1, command.options[i].type.length)}Option](option => option.setName(command.options[i].name).setDescription(command.options[i].description).setRequired(command.options[i].required))
29 replies