fix guild whitelist spam

This commit is contained in:
jane 2021-10-08 22:10:20 -04:00
parent 047083d126
commit c168c5bf99

View file

@ -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]);