Credits script functions¶
Functions for C# (Cb.Call) and Python (cb.call). See Script functions for how to use them.
credits.add¶
Adds a name to your end-of-stream credits, in any section. A name that is already in the section gets its count and amount raised.
| Value | What to put in |
|---|---|
section |
The section: a built-in one like "follows", "raids" or "tips", or your own name like "Special thanks". |
user |
Optional. The name to show, like "CoolViewer42". Leave it out for the user of the trigger. |
platform |
Optional. The platform, like "twitch". Leave it out for the platform of the trigger. |
amount |
Optional. A number to add up, like 5 for a tip of 5. Leave it out for 0. |
detail |
Optional. Extra text shown with the name, like "Tier 1". |
Gives back: true. Fails when the section or the user is empty.
var answer = await Cb.Call("credits.add", new { section = "Special thanks", user = "CoolViewer42", detail = "Made the overlay" });
answer = cb.call("credits.add", section="Special thanks", user="CoolViewer42", detail="Made the overlay")
credits.get¶
Gives you the credits collected so far this stream, for your own credits overlay or a chat message.
Gives back: An object with startedAt, updatedAt and sections. Each section has id, title and entries; each entry has user, platform, count, amount and detail.
var answer = await Cb.Call("credits.get");
answer = cb.call("credits.get")
credits.reset¶
Clears the credits, so the next stream starts empty.
Gives back: true.
var answer = await Cb.Call("credits.reset");
answer = cb.call("credits.reset")
credits.test¶
Gives you made-up sample credits, so you can design a credits overlay without waiting for a real stream. Your real credits do not change.
Gives back: Sample credits in the same shape as credits.get (with isTest set to true).
var answer = await Cb.Call("credits.test");
answer = cb.call("credits.test")