User in Group
Check if a Twitch user is a member of a given group

User in Group Dialog
Parameters
User Login
String required
can be a user name or a variable like %userName%
Group Name
String required
can be a specific group name or a variable
Variables
Name | Type | Description |
---|---|---|
Example Value: GenericUser the user's display name | ||
Example Value: 12345678 the user's ID | ||
Example Value: genericuser the user's login name | ||
Example Value: twitch the user's platform | ||
Example Value: True/False indicator whether the user is in the specified group or not |
C# Usage
Check if a user, by username (login name), is a member of a group
0.2.3
public bool UserInGroup(string userName, Platform platform, string groupName)
userNamestring required platformPlatform required groupNamestring required
using System;
public class CPHInline
{
public bool Execute()
{
//Define the groupname you want to add the user to
string groupName = "Test Group";
//Get userName of current user
CPH.TryGetArg("userName",out string userName);
//Get user type and define the Platform Enum
CPH.TryGetArg("userType",out string userType);
Enum.TryParse(userType, out Platform platform);
//Method returns a bool type which you can check if the user is in group
bool userInGroup = CPH.UserInGroup(userName, platform, groupName);
return true;
}
}