diff --git a/src/commands/index.ts b/src/commands/index.ts index 651c3c6..1bc3721 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -5,6 +5,7 @@ import { default as IssueCommand } from './issue.js'; import { default as PTALCommand } from './ptal.js'; import { default as SolvedCommand } from './solved.js'; import { default as TweetCommand } from './tweet.js'; +import { default as SupportCommand } from './support.js'; // import {default as RetriggerStatisticsCommand} from "./retriggerStatistics"; type CommandList = { @@ -18,6 +19,7 @@ const commandList: CommandList = { ptal: PTALCommand, tweet: TweetCommand, solved: SolvedCommand, + support: SupportCommand, //"retrigger-statistics": RetriggerStatisticsCommand }; diff --git a/src/commands/support.ts b/src/commands/support.ts new file mode 100644 index 0000000..88958ec --- /dev/null +++ b/src/commands/support.ts @@ -0,0 +1,26 @@ +import { SlashCommandBuilder } from "@discordjs/builders"; +import type { Command } from "../types"; +import type { Env } from ".."; + +const command: Command = { + data: new SlashCommandBuilder() + .setName("support") + .setDescription("Summon support patrol"), + async initialize(env: Env) { + if (!env.SUPPORT_PATROL_ID) { + console.warn("SUPPORT_PATROL_ID is not defined"); + return false; + } + return true; + }, + async execute(client) { + const role = `<@${client.env.SUPPORT_PATROL_ID}>`; + const message = `Houston, we have a problem... and ${role}, you’re our mission control! 🚀`; + + return client.reply({ + content: message, + }); + }, +}; + +export default command; diff --git a/src/index.ts b/src/index.ts index ed8e02c..7d53b2c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -38,6 +38,7 @@ export interface Env { GUILD_ID?: string; SUPPORT_CHANNEL?: string; SUPPORT_AI_CHANNEL?: string; + SUPPORT_PATROL_ID?: string; SUPPORT_SQUAD_CHANNEL?: string; STATS_SCHEDULE?: string; SUPPORT_REDIRECT_SCHEDULE?: string;