feat: sanction DM links and per-event colour coding (#13)
Node.js CI / CI (push) Successful in 28s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 2m12s

## Summary

- Adds resource links (appeal form, sanction logs, contact page, community invite) to all sanction DMs, separated from the sanction text by a Components v2 separator
- Adds a unique accent colour for every mod log and activity log event type, giving each action a distinct visual identity at a glance

## Changes

- `src/utils/components.ts` — Added `sanctionDmMessage` helper with two-section container (sanction text + links); added full `Colours` palette covering all sanction and activity event types; added `ColourKey` export
- `src/commands/{ban,kick,mute,softban,warn}.ts` — Updated DMs to use `sanctionDmMessage` with the appropriate colour
- `src/modules/logModAction.ts` / `logActivity.ts` — Thread `colour` parameter through to message builders
- All event and command files updated with their respective colours

 This PR was created with help from Hikari~ 🌸

Reviewed-on: #13
Co-authored-by: Hikari <hikari@nhcarrigan.com>
Co-committed-by: Hikari <hikari@nhcarrigan.com>
This commit was merged in pull request #13.
This commit is contained in:
2026-03-31 17:33:35 -07:00
committed by Naomi Carrigan
parent 01d6da8a33
commit 453ebd0f15
20 changed files with 140 additions and 23 deletions
+5 -2
View File
@@ -6,11 +6,12 @@
import { ChannelType, type Client } from "discord.js";
import { channelConfig } from "../config/channels.js";
import { activityMessage } from "../utils/components.js";
import { activityMessage, type ColourKey } from "../utils/components.js";
import { logger } from "../utils/logger.js";
interface ActivityData {
readonly client: Client;
readonly colour: ColourKey;
readonly emoji: string;
readonly fields: string;
readonly title: string;
@@ -35,7 +36,9 @@ const logActivity = async(data: ActivityData): Promise<void> => {
return;
}
await rawChannel.send(activityMessage(data.emoji, data.title, data.fields));
await rawChannel.send(
activityMessage(data.emoji, data.title, data.fields, data.colour),
);
} catch (error) {
await logger.error(
"Failed to log activity",
+3 -2
View File
@@ -7,11 +7,12 @@
import { ChannelType, type Client } from "discord.js";
import { channelConfig } from "../config/channels.js";
import { modLogMessage } from "../utils/components.js";
import { modLogMessage, type ColourKey } from "../utils/components.js";
import { logger } from "../utils/logger.js";
interface ModuleActionData {
readonly action: string;
readonly colour: ColourKey;
readonly emoji: string;
readonly moderatorTag: string;
readonly reason: string;
@@ -57,7 +58,7 @@ const logModerationAction = async(
join("\n");
await rawChannel.send(
modLogMessage(`${data.emoji} ${data.action}`, fields, data.source),
modLogMessage(`${data.emoji} ${data.action}`, fields, data.source, data.colour),
);
} catch (error) {
await logger.error(