feat: make #sl status command trigger configurable (exact match, max 32 char) (#138)

* feat: make #sl status command trigger configurable (exact match, max 32 char)

The trigger word for the built-in #sl status command is now configurable
via statusCommand.trigger, with exact case-insensitive matching preserved.

* chore: reject control chars in trigger + add sync assertion
This commit is contained in:
stla authored and GitHub committed 2026-06-25 01:02:17 +08:00
1 parent 19c03eb0ba
commit 41bad7f24c
9 files changed
+147 -47

No files matched your search

+1 -1
View File
@@ -189,7 +189,7 @@ export class OneBotInstance {
if (!cfg.enabled) return false;
const postType = event.post_type;
if (postType !== 'message' && postType !== 'message_sent') return false;
if (!matchesStatusCommand(event.message)) return false;
if (!matchesStatusCommand(event.message, cfg.trigger)) return false;
const isGroup = event.message_type === 'group';
const sessionId = isGroup ? toInt(event.group_id) : toInt(event.user_id);