feat(commands): add /commands slash list

This commit is contained in:
LK
2026-01-08 16:02:54 +01:00
parent c20a12aa7b
commit 559e175b38
7 changed files with 81 additions and 2 deletions

View File

@@ -43,6 +43,7 @@ import {
} from "../group-activation.js";
import { parseSendPolicyCommand } from "../send-policy.js";
import {
buildCommandsMessage,
buildHelpMessage,
buildStatusMessage,
formatContextUsageShort,
@@ -404,6 +405,17 @@ export async function handleCommands(params: {
return { shouldContinue: false, reply: { text: buildHelpMessage() } };
}
const commandsRequested = command.commandBodyNormalized === "/commands";
if (allowTextCommands && commandsRequested) {
if (!command.isAuthorizedSender) {
logVerbose(
`Ignoring /commands from unauthorized sender: ${command.senderE164 || "<unknown>"}`,
);
return { shouldContinue: false };
}
return { shouldContinue: false, reply: { text: buildCommandsMessage() } };
}
const statusRequested =
directives.hasStatusDirective ||
command.commandBodyNormalized === "/status";