koishi-core
Advanced tools
Comparing version 2.0.0-alpha.25 to 2.0.0-alpha.26
@@ -51,3 +51,3 @@ /// <reference types="node" /> | ||
} | ||
export declare type UserType<T> = T | ((user: UserData) => T); | ||
export declare type UserType<T, U extends UserField = UserField> = T | ((user: Pick<UserData, U>) => T); | ||
export interface CommandConfig { | ||
@@ -54,0 +54,0 @@ /** description */ |
@@ -259,5 +259,4 @@ "use strict"; | ||
const command = this._getCommandByRawName(name); | ||
if ((command === null || command === void 0 ? void 0 : command.context.match(meta)) && !command.getConfig('disable', meta)) { | ||
if (command === null || command === void 0 ? void 0 : command.context.match(meta)) | ||
return command; | ||
} | ||
} | ||
@@ -264,0 +263,0 @@ /** 在元数据上绑定一个可观测群实例 */ |
@@ -23,3 +23,3 @@ "use strict"; | ||
await app.execute({ | ||
command: app.command('help'), | ||
command: 'help', | ||
args: [command.name], | ||
@@ -127,2 +127,5 @@ meta, | ||
} | ||
const disabled = command.getConfig('disable', meta); | ||
if (disabled) | ||
output[1] += '(指令已禁用)'; | ||
if (command._aliases.length > 1) { | ||
@@ -135,6 +138,6 @@ output.push(`别名:${Array.from(command._aliases.slice(1)).join(',')}。`); | ||
} | ||
const name = validate_1.getUsageName(command); | ||
const maxUsage = command.getConfig('maxUsage', meta); | ||
const minInterval = command.getConfig('minInterval', meta); | ||
if (meta.$user) { | ||
if (!disabled && meta.$user) { | ||
const name = validate_1.getUsageName(command); | ||
const minInterval = command.getConfig('minInterval', meta); | ||
const count = validate_1.getUsage(name, meta.$user); | ||
@@ -141,0 +144,0 @@ if (maxUsage < Infinity) { |
{ | ||
"name": "koishi-core", | ||
"description": "Core features for Koishi", | ||
"version": "2.0.0-alpha.25", | ||
"version": "2.0.0-alpha.26", | ||
"main": "dist/index.js", | ||
@@ -39,4 +39,4 @@ "typings": "dist/index.d.ts", | ||
"get-port": "^5.1.1", | ||
"koishi-database-memory": "^2.0.0-alpha.25", | ||
"koishi-test-utils": "^4.0.0-alpha.25" | ||
"koishi-database-memory": "^2.0.0-alpha.26", | ||
"koishi-test-utils": "^4.0.0-alpha.26" | ||
}, | ||
@@ -47,3 +47,3 @@ "dependencies": { | ||
"escape-string-regexp": "^4.0.0", | ||
"koishi-utils": "^2.0.2", | ||
"koishi-utils": "^2.0.3", | ||
"leven": "^3.1.0", | ||
@@ -50,0 +50,0 @@ "ms": "^2.1.2", |
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
275402
4106
Updatedkoishi-utils@^2.0.3