69 lines
2.1 KiB
JavaScript
69 lines
2.1 KiB
JavaScript
const { SlashCommandBuilder } = require("discord.js")
|
|
const { color } = require("../config/options.json")
|
|
const { guildMember } = require("./guild/member.js")
|
|
const { guildInfo } = require("./guild/info.js")
|
|
|
|
module.exports = {
|
|
name: "guild",
|
|
description: "Subcommands for guilds",
|
|
type: "slash",
|
|
|
|
data: new SlashCommandBuilder()
|
|
.setName("guild")
|
|
.setDescription("Subcommands for guilds")
|
|
.addSubcommand(subcommand =>
|
|
subcommand
|
|
.setName("member")
|
|
.setDescription("Get info about a guild memeber")
|
|
.addStringOption(option =>
|
|
option
|
|
.setName("ign")
|
|
.setDescription("The IGN of the player.")
|
|
.setRequired(true)
|
|
)
|
|
)
|
|
.addSubcommand(subcommand =>
|
|
subcommand
|
|
.setName("info")
|
|
.setDescription("Get info about a guild.")
|
|
.addStringOption(option =>
|
|
option
|
|
.setName("ign")
|
|
.setDescription("The IGN of a member.")
|
|
.setRequired(true)
|
|
)
|
|
)
|
|
.setDMPermission(false),
|
|
|
|
/** @param { import('discord.js').ChatInputCommandInteraction } interaction */
|
|
|
|
async execute(interaction) {
|
|
|
|
await interaction.deferReply()
|
|
|
|
const subcommand = interaction.options.getSubcommand()
|
|
const embedColor = Number(color.replace("#", "0x"))
|
|
|
|
if (subcommand === "member") {
|
|
await guildMember(interaction)
|
|
return
|
|
}
|
|
|
|
if (subcommand === "info") {
|
|
await guildInfo(interaction)
|
|
return
|
|
}
|
|
|
|
await interaction.editReply({
|
|
embeds: [{
|
|
description: "This command is currently under development",
|
|
color: embedColor,
|
|
footer: {
|
|
text: interaction.guild.name + " | Developed by taken.lua",
|
|
icon_url: interaction.guild.iconURL({ dynamic: true })
|
|
}
|
|
}]
|
|
})
|
|
}
|
|
}
|