From c6eb2f1e2c5ffdb13f8d47b1637c1d6bc267daa6 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 9 Jul 2023 21:18:08 +0300 Subject: [PATCH] Remove coach command --- discord-bot/commands/coach.ts | 49 ----------------------------------- discord-bot/commands/index.ts | 2 -- 2 files changed, 51 deletions(-) delete mode 100644 discord-bot/commands/coach.ts diff --git a/discord-bot/commands/coach.ts b/discord-bot/commands/coach.ts deleted file mode 100644 index 8a808c924..000000000 --- a/discord-bot/commands/coach.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { SlashCommandBuilder } from "@discordjs/builders"; -import type { GuildMemberRoleManager } from "discord.js"; -import ids from "../ids"; -import type { BotCommand } from "../types"; - -const COMMAND_NAME = "coach"; -const ACTION_ARG = "action"; - -export const coachRoleCommand: BotCommand = { - guilds: [ids.guilds.sro], - name: COMMAND_NAME, - builder: new SlashCommandBuilder() - .setName(COMMAND_NAME) - .setDescription( - "Turn on/off role indicating you are available to coach other players" - ) - .addStringOption((option) => - option - .setName(ACTION_ARG) - .setDescription("Add or remove the role?") - .setRequired(true) - .addChoices( - { - name: "add", - value: "add", - }, - { - name: "remove", - value: "remove", - } - ) - ), - execute: async ({ interaction }) => { - const roleBeingAdded = interaction.options.getString(ACTION_ARG) === "add"; - const commandUserRoles = interaction.member - ?.roles as GuildMemberRoleManager; - - if (roleBeingAdded) { - await commandUserRoles.add(ids.roles.sroCoach); - } else { - await commandUserRoles.remove(ids.roles.sroCoach); - } - - return interaction.reply({ - content: roleBeingAdded ? "Role added" : "Role removed", - ephemeral: true, - }); - }, -}; diff --git a/discord-bot/commands/index.ts b/discord-bot/commands/index.ts index f88ce3fd4..afed8ea01 100644 --- a/discord-bot/commands/index.ts +++ b/discord-bot/commands/index.ts @@ -5,7 +5,6 @@ import { plusCommand } from "./plus"; import { updateAllCommand } from "./updateall"; import { pingRolesCommand } from "./pings"; import { colorCommand } from "./color"; -import { coachRoleCommand } from "./coach"; import type { BotCommand } from "../types"; export const commands = [ @@ -16,7 +15,6 @@ export const commands = [ updateAllCommand, pingRolesCommand, colorCommand, - coachRoleCommand, ]; export const commandsMap = Object.fromEntries(commands.map((c) => [c.name, c]));