Posts a CHANGELOG.md release entry to #releases (new DISCORD_CHANGELOG_CHANNEL_ID, falls back to the announce channel). /changelog targets the latest entry; /changelog <version> targets a specific version for catch-up. Rendering is a pure, tested module (bot/lib/changelogRender.ts): entries are split on "# vX.Y.Z" headers, ### sections become bold, bullets become the bullet glyph, and entries over Discord's 4096-char limit are split across messages at section/bullet boundaries with the header re-attached to each chunk. Guild-scoped, staff-only command.
28 lines
1,004 B
TypeScript
28 lines
1,004 B
TypeScript
import type { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
|
|
import type { Payload } from "payload";
|
|
import { pingCommand } from "./ping";
|
|
import { signupCommand } from "./signup";
|
|
import { linkCommand } from "./link";
|
|
import { announceCommand } from "./announce";
|
|
import { changelogCommand } from "./changelog";
|
|
import { remindEvaluationsCommand } from "./remindEvaluations";
|
|
|
|
export interface BotCommand {
|
|
builder: SlashCommandBuilder;
|
|
execute: (interaction: ChatInputCommandInteraction, payload: Payload) => Promise<void> | void;
|
|
/**
|
|
* Registration scope. "global" = available in DMs and every guild the bot is
|
|
* in; "guild" (default) = only the configured guild. Discord never exposes
|
|
* guild-scoped commands in DMs, so DM-only commands like /signup must be global.
|
|
*/
|
|
scope?: "global" | "guild";
|
|
}
|
|
|
|
export const commands: BotCommand[] = [
|
|
pingCommand,
|
|
signupCommand,
|
|
linkCommand,
|
|
announceCommand,
|
|
changelogCommand,
|
|
remindEvaluationsCommand,
|
|
];
|