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);
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;
}

View File

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