Mod only commands in Java Pircbot

Ok so my understanding of what your trying to do is make some kind of mod only command, like !setGame or something that only a chat mod should be able to use.

Your on the right track with your List, your going to want to use the tags that are passed with PircbotX’s MessageEvent, via the event.getTags() method call. Here is the code I use to maintain the list.

ImmutableMap<String, String> userData = event.getTags();
if(userData.get("mod").equals("1") && !this.mods.contains(event.getUser().getNick().toLowerCase())) {
	this.mods.add(event.getUser().getNick().toLowerCase());
}

Where event is the MessageEvent passed from the onMessage method and mods is a List

NOTE: This will only register mods who have talked in chat, which if you put this at the top of your onMessage listener will be fine for command processing because they have to type in chat to do the command.

Then checking if the user issuing a command in an onMessage event is as easy as doing

<command checking> && this.mods.contains(event.getUser().getNick().toLowerCase())

Hope this helps! Feel free to ask if you have any more questions!

Edit: You should be using PircbotX as the other version is horribly outdated. Also make sure you CAP request for twitch.tv/tags

Grayson Briggs