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:
9 files changed
+147
-47
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user