Skip to content
This repository was archived by the owner on Jul 29, 2021. It is now read-only.

Commit db9f446

Browse files
Testing a Build 6 Change
- Fixing incorrect verifyExecution() execution.
1 parent 0fa64f7 commit db9f446

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Project-Lynx/src/main/java/commands/Command.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,13 @@ public boolean verifyExecution(User executor, User interacted, Guild g, MessageC
214214
}
215215
}
216216

217+
// Check if the interacted is an adminstrator
218+
for(Role r: g.getMember(interacted).getRoles()) {
219+
if(r.hasPermission(Permission.ADMINISTRATOR)) {
220+
return false; // Returns false since you're not allowed to do a moderative action against a staff
221+
}
222+
}
223+
217224
//The server owner CAN execute moderator commands WITHOUT having to define the roles (but it would be in the best interest to define them)
218225
if(g.getOwner().getUser().equals(executor)) {
219226
isOwner = true;
@@ -232,6 +239,13 @@ public boolean verifyExecution(User executor, User interacted, Guild g, MessageC
232239
}
233240
}
234241

242+
// Check if the interacted has the same role(s)
243+
for(Role ex_rs: g.getMember(interacted).getRoles()) {
244+
if(cmdPerms.get("ROLE").contains(ex_rs.getIdLong())) {
245+
return false;
246+
}
247+
}
248+
235249
}
236250

237251
if(isMod || isAdmin || isOwner) {

0 commit comments

Comments
 (0)