I am going over my discord bot trying to refactor my code a little and I have this switch case which works perfectly with if/else but it doesn't run in the switch. Any ideas why? I tried a lot of things but I can't get it to work... I am also pretty sure it is a dumb mistake I am doing.. The case in question is the "self" case that is not running. So in normal circumstance it would be
if (getTag == self) {
// code
}
Here is the code. Thanks in advance!
var getTag = message.mentions.users.first();
var self = message.author.id;
switch (getTag) {
case undefined:
// sample
break;
case self:
// sample
break;
case client.user:
// sample
break;
default:
// sample
break;
}