 Do you have chat commands in your stream that can be used freely, but you wish they were a bit less free to the people that don't actually stick around? Let's talk about how to create a bit more fine-grained permissions in Streamerbot using custom groups. We'll go through this in four parts. How to manually create and manage groups through the Streamerbot UI. How to leverage these groups to set more specific permissions for commands and actions. How to let users add themselves to a group. How to build a group automatically based on some criteria like follow age. First we're going to talk about how to manually manage groups through the Streamerbot UI. You may have never seen the option to make groups if you haven't dug around a bunch. The groups can be found by clicking the settings tab and then the groups tab. To create a group, type a name in the lower box and press add. You have the option here to designate a group as a bot group, which will exclude any of these users from the credit system. There may be future features that leverage this as well, but so far this is it. We'll be building a tool to leverage a bot group later in this video. To remove a group, right click and then choose delete from the context menu. You can also click through your groups and review who is in them, but adding or removing users to groups is done in the viewers tab. You can export and import your groups to and from files here as well. Once you have groups created, you can also look at your active viewer list on the viewers tab. And from here, you can right click users and assign them to your groups easily. If you wish to see viewers that are not presently in your chat, uncheck the hide not present checkbox. See all users that Streamerbot is aware of. This unfiltered list may be massive for some streamers, so beware. That's pretty much it as far as manual manipulation of groups goes. We'll talk about some automated ways to assign users to groups in a little bit, but first, let's talk about what we can do with these groups. The primary use for groups is to have more fine-tuned control over who can use your command. If you've restricted commands to moderators or subscribers or VIPs before, it's done in the very same way. And you'll see that your groups will now show up on this list along with those designations. Go to the commands tab and pick the command that you want to restrict to a particular group and open it up. The whole right panel is for permissions and you can specify permissions in two fundamental ways. The allow method defines who can use the command and any users or groups not included cannot. The deny method defines which groups or users cannot use the command and anyone not listed can use it. Honestly, I've only ever used the allow method, so that's what I'll speak about and we'll leave the drop down at the top set to allow. To restrict access to this command, only to people in the group you just defined, simply click that group in the available box and then click the right facing arrow to add this group to the allowed list. Now only members of that group can use this command. Easy. The second way I've found to use this is to check if a user is in a group to restrict access directly within an action. In a previous video, I shared a sub-action that can be used to have your actions ignore bots. Now I realize that I could have just used a group for that instead of a flat text file and it becomes a lot easier to manage. So I'm going to update it here. To do this, I've set up a group very creatively called bot group and assigned a number of the bots known to my channel, including Flarebot. I've then set up an action called eyebreak for bot group members, very similar to the one I shared in my previous video. Purpose of this action is to halt the execution of another action. If the user who triggered it is in the bot group, I'll put an import code for this action in the description, but we'll go through it real quick too. There's a quick set argument sub-action to specify which group we're concerned with. Then we run a small C-sharp sub-action, which basically just checks whether or not the user is in the group and if they are, it returns false, which will halt the execution of the action and also any parent action that happens to call this action. This allows us to use this as a sub-action in our other actions to act as a gatekeeper for bots. To demonstrate this, I've set up a test action that basically just calls this eyebreak for bot group members action as a sub-action and then sends the word hello in a message to Twitch. I've assigned this action to the exclamation test command for testing purposes. If I go over to chat, you can see that if I type exclamation test myself, you'll see the hello message. But if I switch over to flare bot and use the exclamation test command, nothing happens because the eyebreak for bot group members sub-action halted execution successful and that line that sends the message hello never ran. Now you can just drop this into any action that you want to prevent your bots from executing. I use it for things like welcoming users when they type their first words in chat, so I'm not greeting my bots and also so that bot spot doesn't trigger commands. Now we can manually create groups and add users and we can use these groups to add some more fine-tuned controls to our commands and actions. Let's go through a few more complex examples of leveraging groups that you might find a use for too. You may have a set of commands that you want people to be able to earn permission for one way or another, so we can create a group for that and have it populate automatically in a number of ways. First, you could create a channel point reward that allows people to add themselves to a group. You could use this to give access to a whole bonus tier of chat commands or use the group for giveaway access or anything else you can think of. To do this, I've set up another action called join group and you'll find the import code in the description below. The gist of this action is that it gets the info from the person that triggered the action and uses a very simple C-sharp sub-action to add them to the group. It'll also report that the user has been added or if they're already in the group it'll mention that as well. You can configure which group this action allows users to join by setting the value in the set argument sub-action and then you can just assign this action to a channel point reward or even a regular chat command equation. What about automatically populating a group based on some specific condition? I was recently asked on my player queue video about how to restrict a certain command only to people who had been following for a particular amount of time like 60 minutes. While there are a number of ways that this could be done directly in the action for that command or otherwise, I felt it was a great opportunity to explore creating your group based on follow time so that's what I did. Once again, I'll drop the import code in the description below but we'll do a quick rundown how it works too. It's kind of a lot so I'm gonna kind of whip through it since you can just import the code and change a few variables if necessary. Essentially it relies on parsing the current present viewers in the stream and if they meet the required conditions they're added to the group. In our example we're going to use the condition that they've followed for at least 60 minutes. So we're assigning this action to the iterate present viewers trigger within the platforms, twitch, events, general tab. I leave the live update checkbox unchecked and have the threshold slider set to 5 minutes. This basically makes it check every minute for live users and those that have been present within the last five minutes count as present regardless of how you prefer this to be set up, what we're about to do should still work. The action itself has a few configuration variables you can tweak. You can set the name of the group you want to automatically create which I have set by default to players and you can specify the amount of time and minutes you want the user to have followed which I have set by default to 60 but you could do the math and set this to days or weeks or more if you so desire. Then a C-sharp subaction runs which iterates through the current list of present viewers and for each one called another action called viewer parse. This is necessary because without using a third party API call you cannot get follow age for a user from within C-sharp. So I build another action that grabs the follow age for the target and then passes it back into C-sharp which simply checks if the user has been following long enough and whether or not they're already in the group and then adds them to the group if appropriate. Please feel free to reach out to me if you want a more in-depth explanation or stop by my streams on Sunday and Monday nights and I'll show you a directive. You can use this to automatically make a group of users who have been following for at least an hour. This can then be applied as a restriction on commands as needed. What command would you lock down with a group like this? Is there some other criteria by which you would like to establish a new group automatically? Let me know in the comments. For now check out my video about the player queue module.