core has string escape now, utilize it
This commit is contained in:
parent
ecb8c2a69c
commit
f0a3c56b32
@ -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;
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
"plugins": [
|
||||
{
|
||||
"name": "control",
|
||||
"version": "0.1.3"
|
||||
"version": "0.2.0"
|
||||
},
|
||||
{
|
||||
"name": "cron",
|
||||
|
Loading…
Reference in New Issue
Block a user