Add config option for prefixes

This commit is contained in:
1computer1 2019-05-16 21:02:44 -04:00
parent 9e9cf31329
commit f34cd8e427
4 changed files with 8 additions and 3 deletions

View file

@ -59,8 +59,9 @@ class MessageInvalidListener extends Listener {
}
parseMessage(message) {
const regex1 = /^\s*>\s*(.+?)?\s*```(.+?)\n([^]+)```\s*$/;
const regex2 = /^\s*>\s*(.+?)?\s*`(.+?) \s*([^]+)`\s*$/;
const prefix = this.client.config.codePrefix.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
const regex1 = new RegExp(`^\\s*${prefix}\\s*(.+?)?\\s*\`\`\`(.+?)\\n([^]+)\`\`\`\\s*$`);
const regex2 = new RegExp(`^\\s*${prefix}\\s*(.+?)?\\s*\`(.+?) \\s*([^]+)\`\\s*$`);
const match = message.content.match(regex1) || message.content.match(regex2);
if (!match) {
return null;

View file

@ -13,7 +13,7 @@ class CompilerClient extends AkairoClient {
this.commandHandler = new CommandHandler(this, {
directory: path.join(__dirname, '../commands'),
prefix: '>',
prefix: config.prefix,
allowMention: true,
commandUtil: true,
commandUtilLifetime: 3e5,