StreamElements script functions¶
Functions for C# (Cb.Call) and Python (cb.call). See Script functions for how to use them.
streamelements.addUserPoints¶
Gives a viewer StreamElements loyalty points. Use a minus number to take points away. Needs your StreamElements token; fails with an error otherwise.
| Value | What to put in |
|---|---|
user |
The viewer's name, like "CoolViewer". Needed. |
amount |
How many points to add, like 100. Use a minus number, like -50, to take points away. |
Gives back: The viewer's new points total.
var answer = await Cb.Call("streamelements.addUserPoints", new { user = "CoolViewer", amount = 100 });
answer = cb.call("streamelements.addUserPoints", user="CoolViewer", amount=100)
streamelements.getPointsLeaderboard¶
Gets the viewers with the most StreamElements loyalty points. Needs your StreamElements token; fails with an error otherwise.
| Value | What to put in |
|---|---|
count |
Optional. How many people to get. Default 5. |
Gives back: A list of the viewers with the most points. Each has user and points.
var answer = await Cb.Call("streamelements.getPointsLeaderboard", new { count = 10 });
answer = cb.call("streamelements.getPointsLeaderboard", count=10)
streamelements.getTipLeaderboard¶
Gets the viewers who tipped you the most on StreamElements. Needs your StreamElements token; fails with an error otherwise.
| Value | What to put in |
|---|---|
count |
Optional. How many people to get. Default 5. |
Gives back: A list of the top tippers. Each has user and total (how much they tipped).
var answer = await Cb.Call("streamelements.getTipLeaderboard", new { count = 3 });
answer = cb.call("streamelements.getTipLeaderboard", count=3)
streamelements.getTips¶
Gets your latest StreamElements tips. Needs your StreamElements token; fails with an error otherwise.
| Value | What to put in |
|---|---|
count |
Optional. How many tips to get. Default 5. |
Gives back: A list of tips. Each has user, amount, currency, formattedAmount (like "$5.00"), message and createdAt.
var answer = await Cb.Call("streamelements.getTips", new { count = 5 });
answer = cb.call("streamelements.getTips", count=5)
streamelements.getUserPoints¶
Looks up how many StreamElements loyalty points a viewer has. Needs your StreamElements token on the Donations page; fails with an error otherwise.
| Value | What to put in |
|---|---|
user |
The viewer's name, like "CoolViewer". A leading @ is fine. Needed. |
Gives back: user, points (now), pointsAllTime and rank.
var answer = await Cb.Call("streamelements.getUserPoints", new { user = "CoolViewer" });
answer = cb.call("streamelements.getUserPoints", user="CoolViewer")
streamelements.isConnected¶
Checks whether Cuebot is connected to StreamElements right now.
Gives back: true while connected, otherwise false.
var answer = await Cb.Call("streamelements.isConnected");
answer = cb.call("streamelements.isConnected")
streamelements.sendTestEvent¶
Fakes a StreamElements event inside Cuebot, so you can test your triggers. Nothing is sent to StreamElements and it works without a connection.
| Value | What to put in |
|---|---|
kind |
Optional. Which event: "tip", "merch" or "redemption". Default "tip". |
Gives back: true when the test event was sent, false when the kind is unknown.
var answer = await Cb.Call("streamelements.sendTestEvent", new { kind = "tip" });
answer = cb.call("streamelements.sendTestEvent", kind="tip")