generated from nhcarrigan/template
feat: sanction DM links and per-event colour coding (#13)
## 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:
+10
-2
@@ -14,7 +14,11 @@ import {
|
||||
} from "discord.js";
|
||||
import { logModerationAction } from "../modules/logModAction.js";
|
||||
import { sendSanction } from "../modules/sendSanction.js";
|
||||
import { errorReply, successReply } from "../utils/components.js";
|
||||
import {
|
||||
errorReply,
|
||||
sanctionDmMessage,
|
||||
successReply,
|
||||
} from "../utils/components.js";
|
||||
import { logger } from "../utils/logger.js";
|
||||
import type { Command } from "../interfaces/command.js";
|
||||
|
||||
@@ -155,7 +159,10 @@ const muteCommand: Command = {
|
||||
|
||||
try {
|
||||
await target.send(
|
||||
`You have been muted in **${interaction.guild?.name ?? "the server"}** for **${durationLabel}**.\n**Reason:** ${reason}`,
|
||||
sanctionDmMessage(
|
||||
`You have been muted in **${interaction.guild?.name ?? "the server"}** for **${durationLabel}**.\n**Reason:** ${reason}`,
|
||||
"mute",
|
||||
),
|
||||
);
|
||||
} catch {
|
||||
// DMs may be closed; continue without failing the command.
|
||||
@@ -163,6 +170,7 @@ const muteCommand: Command = {
|
||||
|
||||
await logModerationAction(interaction.client, {
|
||||
action: "Member Muted",
|
||||
colour: "mute",
|
||||
emoji: "🔇",
|
||||
moderatorTag: interaction.user.username,
|
||||
reason: reason,
|
||||
|
||||
Reference in New Issue
Block a user