TFAGaming / DiscordJS-V14-Bot-Template

A Discord bot with commands, components and events handler based on the latest discord.js v14 and fully written in JavaScript.
GNU General Public License v3.0
354 stars 153 forks source link

how to make add slash command options? #22

Closed NavaShield closed 1 year ago

NavaShield commented 1 year ago

i've tried

const { SlashCommandBuilder } = require("discord.js");

module.exports = {
    name: "test",
    description: "test",
    type: 1,
    options: [],
    permissions: {
        DEFAULT_MEMBER_PERMISSIONS: "SendMessages"
    },
    run: async (client, interaction, config, db) => {
        const data = new SlashCommandBuilder()
        .setName('echo')
        .setDescription('Replies with your input!')
        .addStringOption(option =>
            option.setName('input')
                .setDescription('The input to echo back'));
    },
};

but the input option doesnt show up

TomasOlsson commented 1 year ago

https://github.com/TFAGaming/DiscordJS-V14-Bot-Template/wiki#slash-commands-options Check the wiki here. There will be all info you need for it