RemoveUserFromGroup

Remove a user, by username (login name), from a group

Signature

public bool RemoveUserFromGroup(string userName, Platform platform, string groupName)

Parameters

userName
string required

No description provided.

platform
Streamer.bot.Plugin.Interface.Enums.Platform required

The platform this user belongs to

Possible values:

  • Platform.Twitch
  • Platform.YouTube
  • Platform.Trovo
groupName
string required

The name of the group

Return Type

bool

Example

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 was removed
        bool userGotRemoved = CPH.RemoveUserFromGroup(userName, platform, groupName);         return true;
    }
}