Moved code to src folder

This commit is contained in:
2023-11-23 12:38:55 +01:00
parent 932bce6057
commit 0eeb48b2dd
68 changed files with 59 additions and 70 deletions

68
src/commands/guild.js Normal file
View File

@@ -0,0 +1,68 @@
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 })
}
}]
})
}
}