Repository navigation
Reference Script Functions Spending
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.
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")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()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()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")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()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)Cuebot by Tech Daddy Digital · MIT license · Privacy
Cuebot Docs (the same pages, nicer to read)
- Home
- Start here
-
Guides
- Chat commands
- Overlays and alerts
- Writing your own overlay widgets
- Text-to-speech
- Music and now playing
- Points, store and giveaways
- Subathons and goals
- Stream apps and devices
- VTuber apps
- Stream Deck
- The phone app
- Donations and integrations
- Discord bot
- The setup assistant and AI tools
- The assistant on your own computer
- Moving from Streamer.bot
- Cuebot's servers
- Writing code (C# and Python)
- Python in detail
- Using your own code editor
- Controlling Cuebot from other programs
- Backups and your data
- Linux
- Command-line options
- Troubleshooting
- What's experimental
- Reference
