added async execute test
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
import { SlashCommandBuilder } from "@discordjs";
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
CommandInteractionOptionResolver,
|
||||
InteractionCallback,
|
||||
SlashCommandBuilder,
|
||||
} from "@discordjs";
|
||||
// import { drop, help, requestWorker } from "./plugin.ts";
|
||||
import { logMessage } from "@root/logging.ts";
|
||||
import { defaultString } from "@root/defaultString.ts";
|
||||
@@ -19,7 +24,7 @@ import { defaultString } from "@root/defaultString.ts";
|
||||
// }
|
||||
// } else if (command === "help") {
|
||||
// logMessage(message);
|
||||
|
||||
|
||||
// bot.helpers.sendMessage(message.channelId, {
|
||||
// content: defaultString(help()),
|
||||
// });
|
||||
@@ -29,26 +34,34 @@ import { defaultString } from "@root/defaultString.ts";
|
||||
// }
|
||||
|
||||
export const commands = [
|
||||
new SlashCommandBuilder()
|
||||
.setName("rule")
|
||||
.setDescription("Drops one or multiple images using the rule34 API.")
|
||||
.setNSFW(true)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("drop")
|
||||
.setDescription("Drops one or multiple images using the rule34 API.")
|
||||
|
||||
),
|
||||
new SlashCommandBuilder()
|
||||
.setName('gif')
|
||||
.setDescription('Sends a random gif!')
|
||||
.addStringOption(option =>
|
||||
option.setName('category')
|
||||
.setDescription('The gif category')
|
||||
.setRequired(true)
|
||||
.addChoices(
|
||||
{ name: 'Funny', value: 'gif_funny' },
|
||||
{ name: 'Meme', value: 'gif_meme' },
|
||||
{ name: 'Movie', value: 'gif_movie' },
|
||||
))
|
||||
]
|
||||
{
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("rule")
|
||||
.setDescription("Drops one or multiple images using the rule34 API.")
|
||||
.setNSFW(true)
|
||||
.addSubcommand((subcommand) =>
|
||||
subcommand
|
||||
.setName("drop")
|
||||
.setDescription("Drops one or multiple images using the rule34 API.")
|
||||
),
|
||||
},
|
||||
{
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("gif")
|
||||
.setDescription("Sends a random gif!")
|
||||
.addStringOption((option) =>
|
||||
option.setName("category")
|
||||
.setDescription("The gif category")
|
||||
.setRequired(true)
|
||||
.addChoices(
|
||||
{ name: "Funny", value: "gif_funny" },
|
||||
{ name: "Meme", value: "gif_meme" },
|
||||
{ name: "Movie", value: "gif_movie" },
|
||||
)
|
||||
),
|
||||
async execute (interaction: ChatInputCommandInteraction) {
|
||||
const category = interaction.options.getString('category');
|
||||
await interaction.reply(`You chose: ${category}`);
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user