54 lines
1.6 KiB
TypeScript
54 lines
1.6 KiB
TypeScript
import { InteractionContextType, SlashCommandBuilder } from "discord.js"
|
|
import { devMessage, embedColor } from "~/config/options"
|
|
import { ICommand } from "~/typings"
|
|
import guildInfo, { infoSub } from "./guild/info"
|
|
import guildMember, { memberSub } from "./guild/member"
|
|
import guildTop, { topSub } from "./guild/top"
|
|
|
|
export default {
|
|
name: "guild",
|
|
description: "Subcommands for guilds",
|
|
dev: false,
|
|
public: true,
|
|
subcommands: true,
|
|
requiredRole: "none",
|
|
|
|
data: new SlashCommandBuilder()
|
|
.setName("guild")
|
|
.setDescription("Subcommands for guilds")
|
|
.addSubcommand(memberSub)
|
|
.addSubcommand(infoSub)
|
|
.addSubcommand(topSub)
|
|
.setContexts(InteractionContextType.Guild),
|
|
|
|
async execute({ interaction }) {
|
|
const subcommand = interaction.options.getSubcommand()
|
|
|
|
if (subcommand === "member") {
|
|
await guildMember({ interaction })
|
|
return
|
|
}
|
|
|
|
if (subcommand === "info") {
|
|
await guildInfo({ interaction })
|
|
return
|
|
}
|
|
|
|
if (subcommand === "top") {
|
|
await guildTop({ interaction })
|
|
return
|
|
}
|
|
|
|
await interaction.reply({
|
|
embeds: [{
|
|
description: "This command is currently under development",
|
|
color: embedColor,
|
|
footer: {
|
|
text: interaction.guild!.name + " | " + devMessage,
|
|
icon_url: interaction.guild!.iconURL() || undefined
|
|
}
|
|
}]
|
|
})
|
|
}
|
|
} as ICommand
|