From 401d1220e1a5c2f8c37f2147cc392e0cd783b76f Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 24 Sep 2025 02:33:56 -0700 Subject: feat: Appeal slash command --- src/discord/commands.ts | 13 +++++++++++++ src/discord/embeds.ts | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) (limited to 'src/discord') diff --git a/src/discord/commands.ts b/src/discord/commands.ts index 652a20a..5f25097 100644 --- a/src/discord/commands.ts +++ b/src/discord/commands.ts @@ -71,6 +71,19 @@ export const COMPLAIN_COMMAND: DiscordCommand = { ], }; +export const APPEAL_COMMAND: DiscordCommand = { + name: "appeal", + description: "Submit an appeal to the moderators", + options: [ + { + type: 3, + name: "message", + description: "Your appeal message", + required: true, + }, + ], +}; + export const COLOURS_COMMAND: DiscordCommand = { name: "colours", description: "Show the distribution of colour roles in the server", diff --git a/src/discord/embeds.ts b/src/discord/embeds.ts index 2eeb800..6873617 100644 --- a/src/discord/embeds.ts +++ b/src/discord/embeds.ts @@ -146,3 +146,38 @@ export const createComplaintEmbed = ( }, }; }; + +export const createAppealEmbed = ( + appealContent: string, + appellant: { username: string; id: string; avatar?: string }, + timestamp: number, + isDM: boolean = true, +): DiscordEmbed => { + return { + title: "📋 New Appeal", + description: appealContent, + color: 0x5865f2, + fields: [ + { + name: "Appellant", + value: `${appellant.username} (${appellant.id})`, + inline: true, + }, + { + name: "Timestamp", + value: ``, + inline: true, + }, + ], + thumbnail: appellant.avatar + ? { + url: `https://cdn.discordapp.com/avatars/${appellant.id}/${appellant.avatar}.png?size=256`, + } + : undefined, + footer: { + text: isDM + ? "Appeal submitted via DM" + : "Appeal submitted from server", + }, + }; +}; -- cgit v1.2.3