koishi-plugin-common
Advanced tools
Comparing version 1.0.0-alpha.3 to 1.0.0-alpha.4
import { Context, CommandConfig } from 'koishi-core'; | ||
export default function apply(ctx: Context, options: CommandConfig): void; | ||
export declare const GLOBAL_HELP_PROLOGUE = "\u5F53\u524D\u53EF\u7528\u7684\u6307\u4EE4\u6709\uFF08\u62EC\u53F7\u5185\u4E3A\u5BF9\u5E94\u7684\u6700\u4F4E\u6743\u9650\u7B49\u7EA7\uFF0C\u6807\u6709\u661F\u53F7\u7684\u8868\u793A\u542B\u6709\u5B50\u6307\u4EE4\uFF09\uFF1A"; | ||
export declare const GLOBAL_HELP_EPILOGUE: string; |
@@ -64,10 +64,14 @@ "use strict"; | ||
} | ||
exports.GLOBAL_HELP_PROLOGUE = '当前可用的指令有(括号内为对应的最低权限等级,标有星号的表示含有子指令):'; | ||
exports.GLOBAL_HELP_EPILOGUE = [ | ||
'群聊普通指令可以通过“@我+指令名”的方式进行触发。', | ||
'私聊或全局指令则不需要添加上述前缀,直接输入指令名即可触发。', | ||
'输入“全局指令”查看全部可用的全局指令。', | ||
'输入“帮助+指令名”查看特定指令的语法和使用示例。', | ||
].join('\n'); | ||
function showGlobalHelp(context, meta, options) { | ||
return meta.$send([ | ||
'当前可用的指令有(括号内为对应的最低权限等级,标有星号的表示含有子指令):', | ||
exports.GLOBAL_HELP_PROLOGUE, | ||
...getCommandList(context, meta, null, options.expand), | ||
'群聊普通指令可以通过“@我+指令名”的方式进行触发。', | ||
'私聊或全局指令则不需要添加上述前缀,直接输入指令名即可触发。', | ||
'输入“全局指令”查看全部可用的全局指令。', | ||
'输入“帮助+指令名”查看特定指令的语法和使用示例。', | ||
exports.GLOBAL_HELP_EPILOGUE, | ||
].join('\n')); | ||
@@ -126,5 +130,2 @@ } | ||
} | ||
else if (command._options.length) { | ||
output.push(`输入“help ${command.name} -o”查看完整的选项列表。`); | ||
} | ||
if (command._examples.length) { | ||
@@ -131,0 +132,0 @@ output.push('使用示例:', ...command._examples.map(example => ' ' + example)); |
{ | ||
"name": "koishi-plugin-common", | ||
"version": "1.0.0-alpha.3", | ||
"version": "1.0.0-alpha.4", | ||
"main": "dist/index.js", | ||
@@ -25,5 +25,5 @@ "typings": "dist/index.d.ts", | ||
"dependencies": { | ||
"koishi-core": "^1.0.0-alpha.3", | ||
"koishi-core": "^1.0.0-alpha.4", | ||
"koishi-utils": "^1.0.0-alpha.1" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
import { GroupContext, GroupMemberInfo, injectMethods, GroupRole, App } from 'koishi-core' | ||
import { GroupMemberInfo, injectMethods, GroupRole, App } from 'koishi-core' | ||
import { difference } from 'koishi-utils' | ||
@@ -3,0 +3,0 @@ import {} from 'koishi-database-mysql' |
@@ -63,10 +63,15 @@ import { Context, Command, UserData, CommandConfig, MessageMeta } from 'koishi-core' | ||
export const GLOBAL_HELP_PROLOGUE = '当前可用的指令有(括号内为对应的最低权限等级,标有星号的表示含有子指令):' | ||
export const GLOBAL_HELP_EPILOGUE = [ | ||
'群聊普通指令可以通过“@我+指令名”的方式进行触发。', | ||
'私聊或全局指令则不需要添加上述前缀,直接输入指令名即可触发。', | ||
'输入“全局指令”查看全部可用的全局指令。', | ||
'输入“帮助+指令名”查看特定指令的语法和使用示例。', | ||
].join('\n') | ||
function showGlobalHelp (context: Context, meta: MessageMeta, options: any) { | ||
return meta.$send([ | ||
'当前可用的指令有(括号内为对应的最低权限等级,标有星号的表示含有子指令):', | ||
GLOBAL_HELP_PROLOGUE, | ||
...getCommandList(context, meta, null, options.expand), | ||
'群聊普通指令可以通过“@我+指令名”的方式进行触发。', | ||
'私聊或全局指令则不需要添加上述前缀,直接输入指令名即可触发。', | ||
'输入“全局指令”查看全部可用的全局指令。', | ||
'输入“帮助+指令名”查看特定指令的语法和使用示例。', | ||
GLOBAL_HELP_EPILOGUE, | ||
].join('\n')) | ||
@@ -129,4 +134,2 @@ } | ||
}) | ||
} else if (command._options.length) { | ||
output.push(`输入“help ${command.name} -o”查看完整的选项列表。`) | ||
} | ||
@@ -133,0 +136,0 @@ |
Sorry, the diff of this file is not supported yet
248763
54
1904
Updatedkoishi-core@^1.0.0-alpha.4