Skip to content

Reference Script Functions Spending

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

Spending 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

spending.add

Adds a purchase by hand, like a cash gift. It counts toward the top spenders like any other purchase.

Value In Python What to put in
user user Optional. Who spent the money. Leave it out for the user of the trigger.
platform platform Optional. The platform to list them under. Leave it out for the platform of the trigger (or Manual).
amount amount How much, like 10.
currency currency Optional. The currency, like "EUR". Leave it out for your chosen currency.
label label Optional. What it was, like "Cash gift".

Gives back: true. Fails when the user is empty or the amount is not more than 0.

C#

var answer = await Cb.Call("spending.add", new { user = "CoolViewer42", platform = "Manual", amount = 10, currency = "USD", label = "Cash gift" });

Python

answer = cb.spending_add(user="CoolViewer42", platform="Manual", amount=10, currency="USD", label="Cash gift")

spending.newStream

Starts a new stream for the top spenders: "stream" lists start empty and exchange rates are fetched again. Cuebot does this by itself when you go live.

Gives back: true.

C#

var answer = await Cb.Call("spending.newStream");

Python

answer = cb.spending_new_stream()

spending.platforms

Lists the platforms anyone has spent money on, so you can ask for each platform's top spenders.

Gives back: A list of platform names, like ["Twitch", "YouTube"].

C#

var answer = await Cb.Call("spending.platforms");

Python

answer = cb.spending_platforms()

spending.remove

Removes what one person spent, for example after a refund or a test.

Value In Python What to put in
user user Whose purchases to remove.
platform platform Optional. Only on this platform. Leave it out for every platform.
period period Optional. stream, day, week, month, year or all. Leave it out for all.

Gives back: How many purchases were removed.

C#

var answer = await Cb.Call("spending.remove", new { user = "CoolViewer42", period = "stream" });

Python

answer = cb.spending_remove(user="CoolViewer42", period="stream")

spending.stream

Tells you about the current stream: when it started and which exchange rates it locked in.

Gives back: An object with id, startedAt, endedAt, currency, ratesSource and ratesDate, or null before anything was bought.

C#

var answer = await Cb.Call("spending.stream");

Python

answer = cb.spending_stream()

spending.top

Gives you the top spenders of a period, on one platform or all of them, highest first, in your chosen currency.

Value In Python What to put in
period period Optional. stream, day, week, month, year or all. Leave it out for stream.
platform platform Optional. One platform, like "Twitch". Leave it out for every platform together.
count count Optional. How many people, like 5. Leave it out for 10.

Gives back: An object with period, platform, currency, total, pending (purchases still waiting for exchange rates) and spenders. Each spender has rank, user, platform, total, count and breakdown (what they spent on each kind of thing, like Cheer or Super Chat).

C#

var answer = await Cb.Call("spending.top", new { period = "week", platform = "Twitch", count = 5 });

Python

answer = cb.spending_top(period="week", platform="Twitch", count=5)

Clone this wiki locally