discord-jda / JDA

Java wrapper for the popular chat & VOIP service: Discord https://discord.com
Apache License 2.0
4.28k stars 737 forks source link

GuildController changes not showing up in server #308

Closed ghost closed 7 years ago

ghost commented 7 years ago

I am attempting to get my bot to change the Nickname of a member on the server using GuildController. When the bot did not have proper permissions, I saw an error, but now that the permissions server-side are fixed, nothing is changing on the Discord Server.

This is the line of code in a MessageReceivedEvent listener that I am using:

event.getTextChannel().getGuild().getController().setNickname(event.getMember(), "Spammer");

MinnDevelopment commented 7 years ago

setNickname(Member, String) returns a RestAction. Please read more about RestAction in our wiki: here-Using-RestAction)

You want to call setNickname(event.getMember(), "Spammer").queue()

ghost commented 7 years ago

I cannot believe I missed that. I am so sorry for wasting your time on this. Thank you so much for your help!