import {SlashCommandBuilder, Interaction, CommandInteraction} from "discord.js"; import {Command} from "./Command"; export class HelloWorldCommand implements Command { private static RESPONSES: string[] = [ 'Hello :)', 'zzzZ... ZzzzZ... huh? I am awake. I am awake!', 'Roll for initiative!', 'I was an adventurerer like you...', 'Hello :) How are you?', ] definition(): SlashCommandBuilder { return new SlashCommandBuilder() .setName("hello") .setDescription("Displays a random response. (commonly used to test if the bot is online)") } async execute(interaction: CommandInteraction): Promise { const random = Math.floor(Math.random() * HelloWorldCommand.RESPONSES.length); await interaction.reply(HelloWorldCommand.RESPONSES[random]); return Promise.resolve(); } }