import { ApplicationCommandOptionType, ChannelType } from "discord.js";
import { ApplyOptions } from "@sapphire/decorators";
import { Command } from "@sapphire/framework";
import { reviewSystem } from "#lib/constants";
@ApplyOptions<Command.Options>({
description: "Post your review",
runIn: ChannelType.GuildText
})
export class ReviewCommand extends Command {
override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand({
name: this.name,
description: this.description,
options: [
{
description: "Member to review",
type: ApplicationCommandOptionType.User,
required: true
},
{
name: "category",
description: "Category of the review",
type: ApplicationCommandOptionType.String,
choices: reviewSystem.categories.map((category) => ({
name: category.label,
value: category.id
})),
required: true
}
]
});
}
override async chatInputRun(
interaction: Command.ChatInputCommandInteraction<"cached">
) {
await interaction.deferReply({ ephemeral: true });
}
}