Converted main codebase to typescript
Signed-off-by: Taken <taken@mairimashita.org>
This commit is contained in:
76
src/commands/staff.ts
Normal file
76
src/commands/staff.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
import { SlashCommandBuilder, PermissionFlagsBits } from "discord.js"
|
||||
import { color, devMessage } from "../../config/options.json"
|
||||
import { Command } from "../interfaces"
|
||||
import { help} from "./staff/help"
|
||||
import { beast } from "./staff/beast"
|
||||
import { updateDiscordRoles } from "./staff/updatediscordroles"
|
||||
|
||||
export = {
|
||||
name: "staff",
|
||||
description: "Subcommands for staff",
|
||||
type: "slash",
|
||||
dev: false,
|
||||
public: false,
|
||||
subcommands: true,
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("staff")
|
||||
.setDescription("Subcommands for staff")
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("help")
|
||||
.setDescription("Get help with staff commands"))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("beast")
|
||||
.setDescription("Check a user for beast reqs")
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("ign")
|
||||
.setDescription("The IGN of the player.")
|
||||
.setRequired(true)
|
||||
)
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("updatediscordroles")
|
||||
.setDescription("Update the discord roles of all guild members")
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
|
||||
async execute(interaction, client) {
|
||||
|
||||
const subcommand = interaction.options.getSubcommand()
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
|
||||
if (subcommand === "help") {
|
||||
help(interaction, client)
|
||||
return
|
||||
}
|
||||
|
||||
if (subcommand === "beast") {
|
||||
beast(interaction)
|
||||
return
|
||||
}
|
||||
|
||||
if (subcommand === "updatediscordroles") {
|
||||
updateDiscordRoles(interaction)
|
||||
return
|
||||
}
|
||||
|
||||
const footerText = interaction.guild ? interaction.guild.name : interaction.user.username
|
||||
const footerIcon = interaction.guild ? interaction.guild.iconURL({ forceStatic: false }) : interaction.user.avatarURL({ forceStatic: false })
|
||||
|
||||
await interaction.reply({
|
||||
embeds: [{
|
||||
description: "This command is currently under development",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: footerText + " | " + devMessage,
|
||||
icon_url: footerIcon!
|
||||
}
|
||||
}]
|
||||
})
|
||||
}
|
||||
} as Command
|
||||
Reference in New Issue
Block a user