diff options
| author | Fuwn <[email protected]> | 2025-09-11 18:13:31 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-09-11 18:13:31 -0700 |
| commit | 1257d1419d04678296441904a5576464ad86ac27 (patch) | |
| tree | 244a3759dcdac1dac71e6714b7be9317f2a30d70 /src/discord/embeds.ts | |
| parent | style: Use base prettier:recommended rules (diff) | |
| download | umabotdiscord-1257d1419d04678296441904a5576464ad86ac27.tar.xz umabotdiscord-1257d1419d04678296441904a5576464ad86ac27.zip | |
feat: Add complaint system
Diffstat (limited to 'src/discord/embeds.ts')
| -rw-r--r-- | src/discord/embeds.ts | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/discord/embeds.ts b/src/discord/embeds.ts index 1fad102..db23f80 100644 --- a/src/discord/embeds.ts +++ b/src/discord/embeds.ts @@ -88,3 +88,38 @@ export const createPostEmbed = (post: RedditPost): DiscordEmbed => { return embed; }; + +export const createComplaintEmbed = ( + complaintContent: string, + complainant: { username: string; id: string; avatar?: string }, + timestamp: number, + isDM: boolean = true, +): DiscordEmbed => { + return { + title: "🚨 New Complaint", + description: complaintContent, + color: 0xff6b6b, + fields: [ + { + name: "Complainant", + value: `${complainant.username} (${complainant.id})`, + inline: true, + }, + { + name: "Timestamp", + value: `<t:${Math.floor(timestamp / 1000)}:F>`, + inline: true, + }, + ], + thumbnail: complainant.avatar + ? { + url: `https://cdn.discordapp.com/avatars/${complainant.id}/${complainant.avatar}.png?size=256`, + } + : undefined, + footer: { + text: isDM + ? "Complaint submitted via DM" + : "Complaint submitted from server", + }, + }; +}; |