Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support patrol command #101

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -18,6 +19,7 @@ const commandList: CommandList = {
ptal: PTALCommand,
tweet: TweetCommand,
solved: SolvedCommand,
support: SupportCommand,
//"retrigger-statistics": RetriggerStatisticsCommand
};

Expand Down
52 changes: 52 additions & 0 deletions src/commands/support.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { SlashCommandBuilder } from "@discordjs/builders";
import { Command } from "../types";
import { random } from "../utils/helpers.js";
import { Env } from "..";

const messages = [
`@role is here to rescue us from confusion! 🦸‍♂️🦸‍♀️`,
`🐚 @role, can you hear our desperate cries for help?`,
`🚨 @role TO THE RESCUEEEEEE! 🚨`,
`@role is swooping in to save the day! 🦸‍♂️🫡`,
`🥺 Help us @role, you’re our only hope to understand this!`,
`🪄 @role has been summoned for their magical support skills.`,
`@role, we need your expertise! You're the 🐐 of support!`,
`@role has been preparing their whole life to solve this ticket 💪`,
`🔮 Long has the prophecy foretold... only @role can fix this issue now.`,
`👋 Oh hey @role, mind giving us a hand here?`,
`👀 @role... a little help? We’re struggling here.`,
`Let’s solve this mystery, @role! 🧐🔍`,
`How do you do, fellow @role members? Need some support tips? 🛹👨‍🦳`,
`@role, it’s time to YEET this issue out of existence 💀`,
`🐸 It’s support time, my @role-ies! Let’s do this!`,
`@role—let us help them! 🙏`,
`✨ Time to shine, @role! Let’s solve this issue!`,
`We believe in your troubleshooting powers, @role 👌`,
`@role—believe in yourself, and all problems can be solved 🧠`,
`Has anybody seen @role? We need their support superpowers 👀`,
`@role Now getting the attention of someone who can help directly to do the thing they volunteered to do`,
`Vote for @role and all your wildest dreams will come true`,
];

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 = random(messages).replaceAll("@role", role);

return client.reply({
content: message,
});
},
};

export default command;
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down