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);
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
"name": "control",
|
"name": "control",
|
||||||
"version": "0.1.3"
|
"version": "0.2.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "cron",
|
"name": "cron",
|
||||||
|
Loading…
Reference in New Issue
Block a user