private async Task unrevokeCommand(IUser user) { try { string output = ""; RevokedRoleCommandAccessUsers revokedUser = new RevokedRoleCommandAccessUsers(); revokedUser = revokedUser.find($"{user.Id}") as RevokedRoleCommandAccessUsers; if (revokedUser != null) { revokedUser.delete(); output += "User removed from the list"; } else { output += "User not found on the list"; } await ReplyAsync(output); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
private Boolean isPermitted() { RevokedRoleCommandAccessUsers revokedRoleCommandAccessUsers = new RevokedRoleCommandAccessUsers(); ulong callerID = this.Context.User.Id; revokedRoleCommandAccessUsers = revokedRoleCommandAccessUsers.find($"{callerID}") as RevokedRoleCommandAccessUsers; if (revokedRoleCommandAccessUsers == null) { return(true); } if (revokedRoleCommandAccessUsers.userID == callerID) { return(false); } return(true); }
private async Task revokeCommand(IUser user) { try { string output = ""; RevokedRoleCommandAccessUsers revokedUser = new RevokedRoleCommandAccessUsers(); revokedUser.userID = user.Id; revokedUser.insert(); output += "User added to the list"; await ReplyAsync(output); } catch (Exception ex) { Console.WriteLine(ex.Message); } }