Skip to content

Reference Script Functions Groups

Kristopher Barrantes edited this page Nov 5, 2026 · 2 revisions

Groups script functions

Also on the Cuebot Docs site.

Functions for C# (Cb.Call) and Python (a cb method each, or cb.call). See Script functions for how to use them.

A Run Python code step in the action editor

groups.add

Puts a viewer in a group, like "Giveaway". The group is made when it does not exist yet. Leave the user out for the person who triggered the action.

Value In Python What to put in
group group The group name, like "Giveaway".
platform platform Optional. The platform, like "twitch". Leave it out for the platform of the trigger.
user user Optional. The user name, like "CoolViewer42" (a leading @ is fine). Leave it out for the user of the trigger.
userId user_id Optional. The user's id on that platform. Leave it out for the id of the trigger's user.

Gives back: true when added, false when they were already in it.

C#

var answer = await Cb.Call("groups.add", new { group = "Giveaway" });

Python

answer = cb.groups_add(group="Giveaway")

groups.clear

Takes every viewer out of a group. The group itself stays.

Value In Python What to put in
group group The group name, like "Giveaway".

Gives back: How many viewers were removed, or -1 when there is no such group.

C#

var answer = await Cb.Call("groups.clear", new { group = "Giveaway" });

Python

answer = cb.groups_clear(group="Giveaway")

groups.contains

Checks whether a viewer is in a group. Matches by user id when both have one, otherwise by name.

Value In Python What to put in
group group The group name, like "Giveaway".
platform platform Optional. The platform, like "twitch". Leave it out for the platform of the trigger.
user user Optional. The user name, like "CoolViewer42" (a leading @ is fine). Leave it out for the user of the trigger.
userId user_id Optional. The user's id on that platform. Leave it out for the id of the trigger's user.

Gives back: true when they are in the group, otherwise false.

C#

var answer = await Cb.Call("groups.contains", new { group = "Giveaway", user = "CoolViewer42" });

Python

answer = cb.groups_contains(group="Giveaway", user="CoolViewer42")

groups.create

Makes a new, empty group.

Value In Python What to put in
group group The group name, like "Giveaway".

Gives back: true when it was made, false when a group with that name already exists.

C#

var answer = await Cb.Call("groups.create", new { group = "Giveaway" });

Python

answer = cb.groups_create(group="Giveaway")

groups.delete

Deletes a group and its member list.

Value In Python What to put in
group group The group name, like "Giveaway".

Gives back: true when it was deleted, false when there was no such group.

C#

var answer = await Cb.Call("groups.delete", new { group = "Giveaway" });

Python

answer = cb.groups_delete(group="Giveaway")

groups.exists

Checks whether a group with this name exists.

Value In Python What to put in
group group The group name, like "Giveaway".

Gives back: true when it exists, otherwise false.

C#

var answer = await Cb.Call("groups.exists", new { group = "Giveaway" });

Python

answer = cb.groups_exists(group="Giveaway")

groups.list

Lists the names of all your groups.

Gives back: A list of group names, like ["Giveaway", "Regulars"].

C#

var answer = await Cb.Call("groups.list");

Python

answer = cb.groups_list()

groups.remove

Takes a viewer out of a group. Leave the user out for the person who triggered the action.

Value In Python What to put in
group group The group name, like "Giveaway".
platform platform Optional. The platform, like "twitch". Leave it out for the platform of the trigger.
user user Optional. The user name, like "CoolViewer42" (a leading @ is fine). Leave it out for the user of the trigger.
userId user_id Optional. The user's id on that platform. Leave it out for the id of the trigger's user.

Gives back: true when removed, false when they were not in it.

C#

var answer = await Cb.Call("groups.remove", new { group = "Giveaway", user = "CoolViewer42" });

Python

answer = cb.groups_remove(group="Giveaway", user="CoolViewer42")

groups.users

Lists the viewers in a group.

Value In Python What to put in
group group The group name, like "Giveaway".

Gives back: A list of members, each with platform, userId and userName. Empty when the group does not exist.

C#

var answer = await Cb.Call("groups.users", new { group = "Giveaway" });

Python

answer = cb.groups_users(group="Giveaway")

Clone this wiki locally