fix guild whitelist spam

master
Jane Petrovna 1 year ago
parent 047083d126
commit c168c5bf99
  1. 8
      parser.js

@ -140,15 +140,15 @@ export default class CommandParser {
if (msg.author.bot) {
return;
}
if (msg.channel.guild && !ctx.whitelist.guild(msg.channel.guild)) {
msg.channel.createMessage('guild not whitelisted');
return;
}
this.log.trace(msg.content);
this.log.trace(msg.content.startsWith(this.prefix));
this.log.trace(msg.content[0]);
this.log.trace(this.prefix);
if (msg.content.startsWith(this.prefix)) {
if (msg.channel.guild && !ctx.whitelist.guild(msg.channel.guild)) {
msg.channel.createMessage('guild not whitelisted');
return;
}
const snip = msg.content.slice(this.prefix.length);
const unsep = snip.split(' ');
const res = this.hasCmd(unsep[0]);

Loading…
Cancel
Save