As the title suggests, I've been experimenting with different versions of the code below. The current version can recognize firstPrefix but not secondPrefix. I simply want my discord bot to be able to identify both prefixes and split the Args accordingly.
const firstPrefix = '!test ';
const secondPrefix = '!testtwo ';
//Prefix
bot.on('message', message => {
message.content = message.content.toLowerCase();
if (message.author.bot || !message.content.startsWith(firstPrefix || secondPrefix)) {
return;
}
//Args split
if (message.content.startsWith(firstPrefix)) {
console.log("A")
var args = message.content.slice(firstPrefix.length).split(/ +/);
}
else if (message.content.startsWith(secondPrefix)) {
console.log("B")
var args = message.content.slice(secondPrefix.length).split(/ +/);
}
I've attempted:
if (message.author.bot || !message.content.startsWith(firstPrefix) || !message.content.startsWith(secondPrefix))
However, that approach did not work at all. I'm quite puzzled here, any assistance would be greatly appreciated. Thank you.