|
@@ -1,5 +1,5 @@
|
|
|
import { isAuthorisedAsync } from "../util";
|
|
|
-import { plgMgr } from "src/main";
|
|
|
+import { plgMgr, COMMAND_PREFIX } from "src/main";
|
|
|
import { Command, ICommandData, Plugin } from "src/model/plugin";
|
|
|
import { client } from "src/client";
|
|
|
|
|
@@ -14,10 +14,15 @@ export class Help {
|
|
|
|
|
|
let baseCommands = "\n";
|
|
|
let modCommands = "\n";
|
|
|
+ let prefixCommands = "\n";
|
|
|
|
|
|
for (const doc of plgMgr.documentation) {
|
|
|
- if (isAuthed && doc.auth)
|
|
|
- modCommands = `${modCommands}${doc.example} - ${doc.doc}\n`;
|
|
|
+ if (isAuthed && doc.auth) {
|
|
|
+ if (doc.type == "prefix")
|
|
|
+ prefixCommands = `${prefixCommands}${COMMAND_PREFIX}${doc.example} - ${doc.doc}\n`;
|
|
|
+ else if (doc.type == "mention")
|
|
|
+ modCommands = `${modCommands}${doc.example} - ${doc.doc}\n`;
|
|
|
+ }
|
|
|
else if (!doc.auth)
|
|
|
baseCommands = `${baseCommands}${doc.example} - ${doc.doc}\n`;
|
|
|
}
|
|
@@ -25,7 +30,7 @@ export class Help {
|
|
|
let msg = `Hello! I am ${client.botUser.username}! My job is to help with C(O)M-related problems!\nPing me with one of the following commands:\n\`\`\`${baseCommands}\`\`\``;
|
|
|
|
|
|
if (isAuthed)
|
|
|
- msg = `${msg}\n👑**Moderator commands**👑\n\`\`\`${modCommands}\`\`\``;
|
|
|
+ msg = `${msg}\n👑**Moderator commands**👑\n\`\`\`${modCommands}\`\`\`\n**Prefix commands**\`\`\`${prefixCommands}\`\`\``;
|
|
|
|
|
|
message.reply(msg);
|
|
|
}
|