From 8d8c4f9f5540c23b0f055fd29c07000eaf832988 Mon Sep 17 00:00:00 2001 From: Shigma Date: Thu, 23 Nov 2023 20:28:46 +0800 Subject: [PATCH] feat(help): use whitespace instead of dot in display, fix #1281 --- plugins/common/help/package.json | 2 +- plugins/common/help/src/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/common/help/package.json b/plugins/common/help/package.json index a353a5b62..3dbe5a121 100644 --- a/plugins/common/help/package.json +++ b/plugins/common/help/package.json @@ -1,7 +1,7 @@ { "name": "@koishijs/plugin-help", "description": "Help plugin for Koishi", - "version": "2.3.3", + "version": "2.4.0", "main": "lib/index.js", "typings": "lib/index.d.ts", "files": [ diff --git a/plugins/common/help/src/index.ts b/plugins/common/help/src/index.ts index 6272af9e9..cc4dc6428 100644 --- a/plugins/common/help/src/index.ts +++ b/plugins/common/help/src/index.ts @@ -196,7 +196,7 @@ function formatCommands(path: string, session: Session<'authority'>, children: C const prefix = session.resolve(session.app.config.prefix)[0] ?? '' const output = commands.map(({ name, displayName, config }) => { - let output = ' ' + prefix + displayName + let output = ' ' + prefix + displayName.replace(/\./g, ' ') output += ' ' + session.text([`commands.${name}.description`, ''], config.params) return output }) @@ -243,7 +243,7 @@ function getOptions(command: Command, session: Session<'authority'>, config: Hel } async function showHelp(command: Command, session: Session<'authority'>, config: HelpOptions) { - const output = [session.text('.command-title', [command.displayName + command.declaration])] + const output = [session.text('.command-title', [command.displayName.replace(/\./g, ' ') + command.declaration])] const description = session.text([`commands.${command.name}.description`, ''], command.config.params) if (description) output.push(description)