core has string escape now, utilize it

This commit is contained in:
Evert Prants 2023-08-03 16:58:34 +03:00
parent ecb8c2a69c
commit f0a3c56b32
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
2 changed files with 19 additions and 4 deletions

View File

@ -485,6 +485,7 @@ class SqueebotCommandsAPIPlugin extends Plugin {
matching = this.permissionMatcher(msg, matching); matching = this.permissionMatcher(msg, matching);
const b = (t: string) => msg.source.format.format('bold', t); const b = (t: string) => msg.source.format.format('bold', t);
const e = (t: string) => msg.source.format.escape(t);
if (args[cmdarg]) { if (args[cmdarg]) {
let found: CommandSpec | null = null; let found: CommandSpec | null = null;
@ -505,13 +506,27 @@ class SqueebotCommandsAPIPlugin extends Plugin {
aliasText = b(`[alias of ${found.alias}]`); aliasText = b(`[alias of ${found.alias}]`);
} }
const description = found.description
? e(found.description)
: 'No description :(';
if (found.usage) { if (found.usage) {
msg.resolve('%s %s -', b(prefix + found.name), found.usage, msg.resolve(
found.description || 'No description :(', aliasText); '%s %s -',
b(prefix + found.name),
e(found.usage),
description,
aliasText
);
return; return;
} }
msg.resolve('%s -', b(prefix + found.name), found.description || 'No description :(', aliasText); msg.resolve(
'%s -',
b(prefix + found.name),
description,
aliasText
);
return; return;
} }

View File

@ -3,7 +3,7 @@
"plugins": [ "plugins": [
{ {
"name": "control", "name": "control",
"version": "0.1.3" "version": "0.2.0"
}, },
{ {
"name": "cron", "name": "cron",