Open saatvikn opened 4 years ago
ok let me see
if i put if (!message.member.hasPermission("ADMINISTRATOR")) return;
under line 484 then wont it return the bot and make it not respond to the command for people with the admin permission?
Returning can be used to end a function early. It would be the same as doing this:
if (message.member.hasPermission("ADMINISTRATOR")) {
// code
}
^ This way should also work With returning, the logic should be the same but without extra brackets:
if (!message.member.hasPermission("ADMINISTRATOR")) return;
// code
It reads as "if member does not have permission administrator, stop" Which should act the same as "if member has permission administrator, continue"
ok
so i will just if (!message.member.hasPermission("ADMINISTRATOR")) return;
put this it will work. right?
btw tysm
This bot does not currently have an admin filter, but it should not be too difficult. There is a good guide for this here.
With this bot I think it could be possible by adding the following check below line 484:
if (!message.member.hasPermission("ADMINISTRATOR")) return;
Hopefully this will prevent the rest of the message event from running if they are not an administrator.