Component
You can create new components in app/component
Decorator
Decoratorparameter
type
required
id
string
type
type ComponentType = "modal" | "button" | "select" | "text-input";Template
Templateimport { Client } from "discord.js";
import { Component, Automatic } from "engine";
@Component("my_select_menu", "select")
export default class MySelectMenuComponent {
public static async callback(client: Client, interaction: Automatic<"select">) {
const selectedValue = interaction.values[0];
await interaction.reply(`You selected ${selectedValue}!`);
}
}Automatic types
Automatic typesinteraction: Automatic<"select"> // all types from ComponentType are availableIs the same with
interaction: StringSelectMenuInteractionLast updated