From f0a3c56b329d422d7654568544084679d7492e1e Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Thu, 3 Aug 2023 16:58:34 +0300 Subject: [PATCH] core has string escape now, utilize it --- simplecommands/plugin.ts | 21 ++++++++++++++++++--- squeebot.repo.json | 2 +- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/simplecommands/plugin.ts b/simplecommands/plugin.ts index 8114057..6f67cd1 100644 --- a/simplecommands/plugin.ts +++ b/simplecommands/plugin.ts @@ -485,6 +485,7 @@ class SqueebotCommandsAPIPlugin extends Plugin { matching = this.permissionMatcher(msg, matching); const b = (t: string) => msg.source.format.format('bold', t); + const e = (t: string) => msg.source.format.escape(t); if (args[cmdarg]) { let found: CommandSpec | null = null; @@ -505,13 +506,27 @@ class SqueebotCommandsAPIPlugin extends Plugin { aliasText = b(`[alias of ${found.alias}]`); } + const description = found.description + ? e(found.description) + : 'No description :('; + if (found.usage) { - msg.resolve('%s %s -', b(prefix + found.name), found.usage, - found.description || 'No description :(', aliasText); + msg.resolve( + '%s %s -', + b(prefix + found.name), + e(found.usage), + description, + aliasText + ); return; } - msg.resolve('%s -', b(prefix + found.name), found.description || 'No description :(', aliasText); + msg.resolve( + '%s -', + b(prefix + found.name), + description, + aliasText + ); return; } diff --git a/squeebot.repo.json b/squeebot.repo.json index d48a577..35418a9 100644 --- a/squeebot.repo.json +++ b/squeebot.repo.json @@ -3,7 +3,7 @@ "plugins": [ { "name": "control", - "version": "0.1.3" + "version": "0.2.0" }, { "name": "cron",