If you're going to add more commands in the future, I'd recommend setting up a dictionary/object, or a switch
statement. Personally, I'd recommend the switch
statement, so here's how you might do that:
if(message.user !== "SirAlfred") {
switch(message.content) {
case "subscribe":
...
break;
...
}
}
Also, you have a bug. Instead of using the !=
and ==
equality operators, you should be using the !==
and ===
identity operators. See this Stackoverflow questionthis Stackoverflow question.