pass through used prefix to commands

This commit is contained in:
Emily 2020-10-29 19:19:59 +11:00
parent 6d57803fe8
commit 678f96a16b

View file

@ -45,6 +45,11 @@ class MessageHandler {
// Ignore the message if it doesn't start with a valid prefix
if (!prefix) return;
// Save prefix so we can use it later (mostly for help command)
if (prefix === `<@${this.client.user.id}> ` || prefix === `<@!${this.client.user.id}> `) {
message.prefix = '@Woomy ';
} else (message.prefix = prefix);
// Turn the message content into an array (excluding the prefix)
const args = message.content.slice(prefix.length).trim().split(/ +/g);