🟢Button

Here's an example of code creating four types of buttons within the same line:

import { ApplicationCommandType } from "discord.js";
import { CreateRow, CreateButton } from "ease-discord-js";

export default {
    name: "test",
    description: "command to test the library",
    type: ApplicationCommandType.ChatInput,

    run: async(client, interaction) => {
       return interaction.reply({content: "Hello World!", components: [
            new CreateRow([
                new CreateButton({customId: "1", label: "Primary", style: "Primary"}),
                new CreateButton({customId: "2", label: "Secondary", style: "Secondary"}),
                new CreateButton({customId: "3", label: "Danger", style: "Danger"}),
                new CreateButton({customId: "4", label: "Primary Disabled", style: "Primary", disabled: true}),
            ])
        ]});
    }
}

The result of this code is this:

Forma simples de como criar um botão, mostrando todos estilos disponíveis

Last updated