Closed cuzitsjonny closed 7 years ago
It's a RestAction, you have to .queue() or complete() it
On Wed, Apr 19, 2017, 11:24 Jonny notifications@github.com wrote:
I'm using the GuildManager by calling net.dv8tion.jda.core.entities.Guild#getController() in a command executor class of my Discord bot. It is possible to add roles to my users by calling net.dv8tion.jda.core.managers.GuildController#addRolesToMember(Member, Collection) but removing roles using net.dv8tion.jda.core.managers.GuildController#modifyMemberRoles(Member, Collection) or net.dv8tion.jda.core.managers.GuildController#removeRolesFromMember(Member, Collection) doesn't seem to be working. It's not throwing any exceptions, it's just not applying the update. My bot has ADMINISTRATOR permissions, so that shouldn't be a problem.
Mentioned command executor for reference:
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/DV8FromTheWorld/JDA/issues/319, or mute the thread https://github.com/notifications/unsubscribe-auth/APDltApA2Z-7VZ8u8jUyjWdfM0EG234cks5rxdK6gaJpZM4NBayU .
cries
This is just embarrassing, I can't believe I forgot the complete() at the end... Thank you, I'm sorry for wasting your time for this! D:
Actually now the roles are stacking. So it's still not removing them in the first operation.
Updated command executor for reference: https://github.com/cuzitsjonny/DiscordBot/blob/master/src/com/cuzitsjonny/discordbot/FactionCommandExecutor.java
Alright, I changed my application logic to use modify instead of a combination of add and remove. Now it's working!
Thanks for the quick reply to my problem though.
I'm using the GuildManager by calling net.dv8tion.jda.core.entities.Guild#getController() in a command executor class of my Discord bot. It is possible to add roles to my users by calling net.dv8tion.jda.core.managers.GuildController#addRolesToMember(Member, Collection) but removing roles using net.dv8tion.jda.core.managers.GuildController#modifyMemberRoles(Member, Collection) or net.dv8tion.jda.core.managers.GuildController#removeRolesFromMember(Member, Collection) doesn't seem to be working. It's not throwing any exceptions, it's just not applying the update. My bot has ADMINISTRATOR permissions, so that shouldn't be a problem.
Mentioned command executor for reference: https://github.com/cuzitsjonny/DiscordBot/blob/master/src/com/cuzitsjonny/discordbot/FactionCommandExecutor.java