From 35ed43155d78db6085bc84bd3fd5224cc7562588 Mon Sep 17 00:00:00 2001 From: colinosterman <32880722+colinosterman@users.noreply.github.com> Date: Sat, 13 Oct 2018 10:46:47 -0500 Subject: [PATCH] Fixed a bug causing the if test on line 136 to always return true --- .../emily/command/administrative/RoleAdminCommand.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/emily/command/administrative/RoleAdminCommand.java b/src/main/java/emily/command/administrative/RoleAdminCommand.java index bb64e226..7cc1d834 100644 --- a/src/main/java/emily/command/administrative/RoleAdminCommand.java +++ b/src/main/java/emily/command/administrative/RoleAdminCommand.java @@ -132,8 +132,9 @@ public String execute(DiscordBot bot, String[] args, MessageChannel channel, Use String roleName = Misc.joinStrings(args, 2); Role role = DisUtil.findRole(guild, roleName); if (role == null) { - List selfRoleList = CGuildRoleAssignable.getRolesFor(CGuild.getCachedId(guild.getIdLong())); - if (!selfRoleList.contains(roleName)) { + List selfRoleList = CGuildRoleAssignable.getRolesFor(CGuild.getCachedId(guild.getIdLong())); + List selfRoleNameList = selfRoleList.stream().map(a->a.roleName).collect(Collectors.toList()); + if (!selfRoleNameList.contains(roleName)) { return "role not found :frowning:"; } } @@ -230,4 +231,4 @@ private void _mutateRole(Role role, Member member, boolean adding) { this.success = false; } } -} \ No newline at end of file +}