mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-18 17:04:15 +02:00
fix(arabot): remove ability for non coordinator to give vegans veg curious
This commit is contained in:
parent
7ec4fc2909
commit
d42cc6be0b
@ -130,14 +130,24 @@ export class VegCuriousCommand extends Command {
|
||||
return info;
|
||||
}
|
||||
|
||||
// Checks if the user is Veg Curious and to give them or remove them based on if they have it
|
||||
if (member.roles.cache.has(IDs.roles.nonvegan.vegCurious)) {
|
||||
// Checks if the command can only be run by Mentor Coordinators
|
||||
if (!modMember.roles.cache.has(IDs.roles.staff.mentorCoordinator)) {
|
||||
// Only Mentor Coordinators can remove Veg Curious role
|
||||
if (member.roles.cache.has(IDs.roles.nonvegan.vegCurious)) {
|
||||
info.message = 'You need to be a mentor coordinator to remove this role!';
|
||||
return info;
|
||||
}
|
||||
|
||||
// Only Mentor Coordinators can give vegans Veg Curious role
|
||||
if (member.roles.cache.has(IDs.roles.vegan.vegan)) {
|
||||
info.message = 'You need to be a mentor coordinator to give vegans this role!';
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
||||
// Checks if the user is Veg Curious and to give them or remove them based on if they have it
|
||||
// Remove the Veg Curious role from the user
|
||||
if (member.roles.cache.has(IDs.roles.nonvegan.vegCurious)) {
|
||||
await member.roles.remove(vegCurious);
|
||||
await roleRemoveLog(user.id, mod.id, vegCurious);
|
||||
info.message = `Removed the ${vegCurious.name} role from ${user}`;
|
||||
|
Loading…
x
Reference in New Issue
Block a user