@koishijs/core
Advanced tools
Comparing version 4.17.0-beta.0 to 4.17.0-beta.1
@@ -484,2 +484,3 @@ import * as utils from '@koishijs/utils'; | ||
prefix?: Computed<string | string[]>; | ||
prefixMode?: 'auto' | 'strict'; | ||
} | ||
@@ -486,0 +487,0 @@ } |
{ | ||
"name": "@koishijs/core", | ||
"description": "Core Features for Koishi", | ||
"version": "4.17.0-beta.0", | ||
"version": "4.17.0-beta.1", | ||
"main": "lib/index.cjs", | ||
@@ -36,3 +36,3 @@ "module": "lib/index.mjs", | ||
"@koishijs/utils": "^7.1.2", | ||
"@satorijs/core": "^3.6.0-alpha.0", | ||
"@satorijs/core": "^3.6.0-alpha.1", | ||
"cordis": "^3.10.4", | ||
@@ -39,0 +39,0 @@ "cosmokit": "^1.5.2", |
@@ -47,2 +47,3 @@ import { Awaitable, defineProperty, Time } from 'cosmokit' | ||
prefix?: Computed<string | string[]> | ||
prefixMode?: 'auto' | 'strict' | ||
} | ||
@@ -286,3 +287,4 @@ } | ||
// guild message should have prefix or appel to be interpreted as a command call | ||
if (argv.root && !isDirect && stripped.prefix === null && !stripped.appel) return | ||
const isStrict = this.config.prefixMode === 'strict' || !isDirect && !stripped.appel | ||
if (argv.root && stripped.prefix === null && isStrict) return | ||
const segments: string[] = [] | ||
@@ -289,0 +291,0 @@ while (argv.tokens.length) { |
@@ -161,2 +161,6 @@ import { defineProperty, Promisify, Time } from 'cosmokit' | ||
prefix: Schema.array(Schema.string().default('')).default(['']).role('table').computed().description('指令前缀字符构成的数组。将被用于指令的匹配。'), | ||
prefixMode: Schema.union([ | ||
Schema.const('auto').description('默认:当存在称呼时允许无前缀触发。'), | ||
Schema.const('strict').description('严格:只有在指令前缀匹配时才允许触发。'), | ||
]).experimental().role('radio').default('auto').description('指令前缀匹配模式。'), | ||
nickname: Schema.array(String).role('table').computed().description('机器人昵称构成的数组。将被用于指令的匹配。'), | ||
@@ -163,0 +167,0 @@ autoAssign: Schema.boolean().default(true).computed().description('当获取不到频道数据时,是否使用接受者作为受理人。'), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
463585
8725