Created
March 16, 2018 16:47
-
-
Save tuvior/5aa9ed48614ee12bdf6f057725cfa76a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sx.blah.discord.handle.impl.events.guild.channel.message.MessageReceivedEvent; | |
import sx.blah.discord.handle.obj.IGuild; | |
import sx.blah.discord.handle.obj.IRole; | |
import sx.blah.discord.handle.obj.IUser; | |
import java.util.List; | |
public class RolePrefixes { | |
IRole pvtRank; | |
String pvt; | |
public void updateEveryone(MessageReceivedEvent event) { | |
IGuild guild = event.getGuild(); | |
List<IUser> users = guild.getUsers(); | |
for (IUser player : users) { | |
if (player.hasRole(pvtRank)) { | |
guild.setUserNickname(player, pvt + " " + player.getName()); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment