#dev-chat

1 messages · Page 38 of 1

hollow bison
#

ah c'est bon j'ai reussi a le faire marcher !

viral patrol
#

Well done! I am happy for you!

#

Also - this was a really nice conversation. I would like to help Google Team for their translation service 🙂

plush rock
#

Is there any way that I can allow multiple bets from the same user on a single contest? Looking at the contest page and the API I don't see anything relevant.

fervent rock
#

What to do when after login, i am getting blank page 😦

#

It seems, youtube login is not working again?

indigo flume
#

It is, we are just having a minor backend issue. Devs are already looking into it.

fervent rock
#

Cool, thank you!

pulsar willow
#

Anyone use websockets in a language other than JS? I'm wondering what the signifigance of the websocket.schema.json file is.

pulsar willow
#

Correct me if I'm wrong; it seems to be for validation.

viral patrol
#

websocket.schema.json is the easiest way to understand what you can receive from websockets.

pulsar willow
#

excuse me. the kappagen won't let me use my own emotes for the cheer trigger

elder dragon
#

I'm trying to look for a way to show a gif when a twitch redemption is done, but I can't see to find it in the streamelements docs, is this even possible within streamelements? If so, where could i find documentation about this

viral patrol
elder dragon
#

Backwards engineering incoming

gritty aurora
#

Hey is there any way I can subscribe to an event where I can see when a sound from SE is playing (i.e TTS or a media request or just an alert). I don't want to interfere with those sounds in my app

#

Outside of the overlay enviroment I mean

#

I thought there might be some ws event where I can connect to, but I couldn't find one, so is it possible?

viral patrol
#

There are websocket events dispatched, but they are real time. In overlay environment you can do something that will forward every event to your webhook, and if it is on same overlay as alertbox, they will use the same queue.

#

@elder dragon there's everything opensource, so it should be an easy start for you 😉

elder dragon
#

I figured i could use the message events because they also show the redemptions

#

But current problem is i don't have affiliate so i can't test it until i get some points from the person I'm making this for lol

gritty aurora
#

Using that logic, is it also possible to get the duration of certain sounds/TTS messages?

elder dragon
viral patrol
#

Unfortunately yes, as those are events that are forwarded to chat

#

There's no hook that forwards raw pubsub to custom widget

elder dragon
#

Sad

pulsar willow
#

So, i think something in MrBoost's Rotating Goal Widget broke because instead of the Bar only adding a Piece of the Progress Bar, it instead fills the whole Progress Bar

#

And yes, I am not on my PC at this time

#

Resetting the goal does not fix this

pulsar willow
#

Untill then, I have made a Makeshift Tip Goal

elfin arch
#

are there by chance any good tutorials for making an overlay/widget from a codepen (html/css/js)?

unreal kestrel
#

Chat is the worst and mods are lame BUT

#

Is there like a dummy proof way to make that happen?

#

I just realized that.

elfin arch
#

~~ obj.detail.event.data.user.ismod ? not sure if this API similar to the TMI API ~~

viral patrol
#

I was using: parseInt(data.tags.mod)

elfin arch
#

is there an example object for that? console.log(obj.detail.event.data) ?

viral patrol
unreal kestrel
#

We're replying to me, right?

elfin arch
#

ya. 🤣

#

thanks @viral patrol for that.

#

that userConfig seems to be like the checkboxes/toggles for the overlay settings on the left.

#

if you were to add a || parseInt(data.tags.mod) in that line 190 if it should filter mods too.

unreal kestrel
#

oh, yeah, i uh

#

I can do that

#

if (!data.tags.mod)

#

if (!data.text.startsWith('!')) {

#

if (!data.text.startsWith('!')) || parseInt(data.tags.mod) {

elfin arch
#
if (!data.text.startsWith('!') || data.tags.mod != '1'){ ...
return ```
#

...now i'm confused. that might be backwards

unreal kestrel
#

Oh.

elfin arch
#

ok updated that... there was a ) out of place. and assuming mod == 1

unreal kestrel
#

It works for realises?! gasp

#

YOLO

#

Updated.

#

Yup it works.

elfin arch
#

😂

unreal kestrel
#

You the man.

#

Or the woman, I dunno.

#

Either way, thanks.

elfin arch
#

lx was the one that gave the object

#

finding the endpoints is the hard part.

unreal kestrel
#

mod is the object, right

#

or is everything you added the object

#

Can you just teach me how to be a coder real quick? Thanks.

elfin arch
unreal kestrel
#

So let's say I wanted it to be VIPs and above, would it be data.tags.vip

elfin arch
#

what does VIP & above mean?

#

.... assuming this is Twtich?

unreal kestrel
#

Always.

#

What'chu thinking this is YouTube? OMEGALUL

#

No but seriously yeah, is Twitch.

#

And VIP is a native Twitch role.

elfin arch
#
{
  "time": 1552400352142,
  "tags": {
    "badges": "broadcaster/1",
    "color": "#641FEF",
    "display-name": "SenderName",
    "emotes": "25:5-9",
    "flags": "",
    "id": "885d1f33-8387-4206-a668-e9b1409a998b",
    "mod": "0",
    "room-id": "85827806",
    "subscriber": "0",
    "tmi-sent-ts": "1552400351927",
    "turbo": "0",
    "user-id": "85827806",
    "user-type": ""
  },
  "nick": "sendername",
  "userId": "123123",
  "displayName": "senderName",
  "displayColor": "#641FEF",
  "badges": [
    {
      "type": "broadcaster",
      "version": "1",
      "url": "https://static-cdn.jtvnw.net/badges/v1/5527c58c-fb7d-422d-b71b-f309dcb85cc1/3",
      "description": "Broadcaster"
    }
  ],
  "channel": "channelname",
  "text": "Test Kappa test",
  "isAction": false,
  "emotes": [
    {
      "type": "twitch",
      "name": "Kappa",
      "id": "25",
      "gif": false,
      "urls": {
        "1": "https://static-cdn.jtvnw.net/emoticons/v1/25/1.0",
        "2": "https://static-cdn.jtvnw.net/emoticons/v1/25/2.0",
        "4": "https://static-cdn.jtvnw.net/emoticons/v1/25/4.0"
      },
      "start": 5,
      "end": 9
    }
  ],
  "msgId": "885d1f33-8387-4206-a668-e9b1409a99Xb"
}
civic ivy
#

I just want to know what the variables are for sparks and embers when making a custom widget. I know they don't work right now. no one will answer and It's not on the official list right now.

#

^on Mixer

elfin arch
#

i dont know the Mixer API or endpoints ...

civic ivy
#

ah, so it's on Mixer's end API I need to find the answer?

elfin arch
#

i'm not sure what you are trying to do 🤔 .... or what a spark or ember is

#

someone with a red name is actual SE staff and might know

civic ivy
#

Embers are Mixer version of bits, I just want to have the information pull up like an alert I've customized. sparks are our miniture bits (they bring up our tip amount by a %). The embers are the more important.

elfin arch
#

@unreal kestrel so with that object, if you want to look for VIPS you'd go to the badges

unreal kestrel
#

Ohh, yeaah.

#

Let me look.

elfin arch
#

add there is also "subscriber": "0", in that object too

civic ivy
elfin arch
#

i don't have mixer or know how it works.

#

if you try to make a custom widget @civic ivy can you 'emumlate' those events in the editor?

glad perch
#

hey everyone, is there an alternative widget to use for the media request system? or is the basic one the only one?

fervent wasp
#

I need help from somebody i know about how i put something i mine "Source on command by Renziito" I have it running. But i dont know how i get it to show something in the box

steady iron
#

@glad perch not that I know

#

@upper bough seems like a job for you

upper bough
glad perch
#

@steady iron do you know if it is possible to make one?

steady iron
#

I tried to make one, and it s tricky, there are some issues playing youtube videos on widgets that I haven't found a way to solve

glad perch
#

@steady iron ah oké

stiff rock
#

where says ChannelID, do i keep that private or can i allow wack that to my bot. its not JWT 1 but like atual channel ID from here https://api.streamelements.com/kappa/v2/songrequest/ChannelID/queue

#

idk do i need keep ChannelID private or not private

NOTE what i working on.

i going try intergrate SE and Streamlabs together on my custom BOT, so like example SE for Music integration because i got no other thing do Music included playlist

streamlabs like alerts from donation, leaderboard and stuff round they api too

native trellis
#

no

#

just the JWT, that should never be given to anyone but a staffmember

stiff rock
#

i mean ChannelID not JWT

#

bit says channelid be like 1979696

#

do that need be private too that what i meant

native trellis
#

this?

stiff rock
#

no like numbers 1 aka 1 wraps that api

#

just numbers not got that

#

part in docs channel

#

atually changed id now and yes that i was talking about @native trellis

#

is that need be public or private? if private i wack to my config file that ppl cant grab

elfin arch
#

the channel in the docs is the Account ID as posted above; i doesn't need to be private, but it would be good practice to hide it with the JWT (WHICH YOU SHOULD NEVER EXPOSE)

#
    GetPointsFromSE: (username) => {
      return fetch(`https://api.streamelements.com/kappa/v2/points/${setup.SE_ACCOUNTID}/${username}`, {
          method: 'GET',
          headers: {
            'Content-Type': 'application/json',
            'Authorization': `Bearer ${setup.SE_JWTTOKEN}`
          },
        })
        .then(...
stiff rock
#

well i guess i broken something

#

doesnt like links as SR system :/

#

idk what i did there but not happy end part of v= because lowing my caps to low caps

at lest works artist - title doe xD

elfin arch
#

ya. don't go to lowercase for youtube links

stiff rock
#

i trying look for fix

#

i cant find fix :/

elfin arch
#

why is it going to lowercase() ?

stiff rock
#

partly yes i have as args

elfin arch
#

not sure where this is in your overall workflow .... but is/are the lowercase()'s needed?

stiff rock
#

less i can invert it have other args no lowercase but idk ¯_(ツ)_/¯

#

my hall bot runs lower case so im might need invert it

#

fixed it

#

is there way i can add and remove peoples points on SE? or is that not a thing?

elfin arch
#

are you using local bot?

stiff rock
#

ik streamlabs has it as thing

stiff rock
#

wdum local bot?

elfin arch
#

selfhosting. hiding your JWT secret

stiff rock
#

and ty @hardy walrus

#

ik im doing and yes its selfhosting because my bot made from my discord bot intergrations.

all my apis and tokens are hiden

#

even i have my own api stuff for my own projects thats hiden

#

@hardy walrus is username like example chisdealhdyt or as ChisdealHDYT or do both work?

hardy walrus
#

I only knew what you wanted. That's about it LUL ¯_(ツ)_/¯

stiff rock
#

ah

#

i figure it out

elfin arch
#

-- nevermind. you got it

stiff rock
#

@elfin arch i show you, ik how i secure stuff and just saying yes most my stuff selfhosted included my APIS

this example for DLive API i Wrap round and format it to work my Plugins / my BOT Intergrations

#

so yeh all stuff secure so mainly only need know paths thats it chisdeGoodman

#

was askign points i feeling going make so they convert my points to Se points

#

all this syncs wide bots mine like, mixer bot, twithc bot, discord and stuff

and only on my channels ONLY!

only bot they add in is my discord bot thats it

#

anyways going crack on but thanks

elfin arch
#

looks good! some people need more help than just the endpoint, but you got it.

#

i like that "online" key. i need that. haha. happy coding brotha.

stiff rock
#

well theres more i made, even made COD API too 😛 so not just 1 thing

#

COD = Call of Duty

#

😛

#

anyways

elfin arch
#

i know COD... pre BO days. MW2 was the best, maybe MW1

#

are there by chance any good tutorials for making an overlay/widget from a codepen (html/css/js)?
@elfin arch

stiff rock
#

right my song request system fixed now,, when i did (command alan walker - faded was trying find videos with alan, so glad fixed that part see hall command text

raw hill
#

Hey can someone maybe help please? There's a few things I need help with regarding the chatbot. For example, I don't want the 8ball to say "8ball says" but there's no way to customize it other than the module. I know there's an option to to add whatever you want the 8ball to say, but I can't find a way to make it where the 8ball doesn't say "the 8ball says". Also same thing for !followage.

tame zealot
#

how do i set in up in my stream where i can shout of peoples channels?
and add overlays if i stream thru my xbox one?

cold smelt
#

How would I create custom goals widgets for twitch in streamelements? Are there guides I could use? I have a progress bar that I want to try to implement as a goal widget.

viral patrol
steady iron
#

@tame zealot you need a PC, a capture card to take the video from your XBOX to it, and a streaming software

sinful ether
#

trying to get on streeam elements web page but just got a blank screen, anyone got any help

steady iron
#

it works correctly for me, have you tried a different web browser or from a different device?

sinful ether
#

i will trry chrome

steady iron
#

@tame zealot for the shoutout command, you need a bot to listen to it, if you already have the SE bot in your Twitch chat, you can simply add a custom command with soimething lkike this: Please take a moment to check out ${1}'s channel, they are playing ${game ${1}} at https://twitch.tv/${channel ${1}} , give it a look at their amazing content and give them a follow/subscribe if you love it!

#

and then you can do !<your command> <streamer name>

viral patrol
raw hill
#

@viral patrol the problem is that I have no idea about coding. These sites are all jiberish to me.

viral patrol
#

@raw hill You can prepare a list of responses on pastebin, then create a command that will fetch one line randomly from there

#

For example: prepare a command that has response ${customapi https://api.thefyrewire.com/twitch/pastebin/uyw596fr}

raw hill
viral patrol
#

That is correct

raw hill
#

Okay. For new pastes, do I create a new one for every phrase?

viral patrol
#

You just replace uyw596fr part with ID you get on pastebin

#

No. You create a single one with possible answers, each in new line

raw hill
#

Okay.

#

Testing it out right now. I'll report back. Thanks again!

#

@viral patrol okay so I created the pastebin. Did what you told me now the command comes back with "Missing paste key!"

viral patrol
#

Ohh. You should remove ${touser} from responses

#

Your command should be ${touser} ${customapi https://api.thefyrewire.com/twitch/pastebin/G6g6ySMx}

#

@raw hill ⤴️

raw hill
#

Got it! Thank you so much!

#

@viral patrol sorry if I'm bothering you, but would you happen to know what the variable for followage is? I don't like the default one, I'm trying to customize it.

viral patrol
#

${customapi https://decapi.me/twitch/followage/${channel}/${user}}

raw hill
#

@viral patrol I ran in to a problem.. Never had this problem on any other bot because it automatically does it for me. So I went on my bot account (custom bot name) and did !followage and it worked. However, if I want to see someone elses followage, it won't tell me. Just tells me mine. So for example, !followage @diffuser

viral patrol
#

So I think it should be ${customapi https://decapi.me/twitch/followage/${channel}/${touser}}

raw hill
#

When I @ a person, gives me 404 Page Not Found.. But works when I don't @ them... monkaS

#

Only type there name without the @

viral patrol
#

Huh. This is because it forwards usernamen with @ to decapi

raw hill
#

So there's no way around it?

#

@viral patrol

viral patrol
#

I am not aware of any currently.

mild cipher
#

Try ${channel ${touser}} instead

raw hill
#

@mild cipher okay one moment

#

@mild cipher "Parsing error at position 55: Mismatched input list, missing end of inputs"

mild cipher
#
${customapi https://decapi.me/twitch/followage/${channel}/${channel ${touser}}}
raw hill
#

@mild cipher IT WORKED! Thank you so much! And @viral patrol for the help with everything else!

raw hill
#

@mild cipher @viral patrol hey I was just wondering, is there any possible way to possibly have a !song command and show what I'm playing on spotify?

viral patrol
#

There is official Spotify extension in twitch extension store.

rugged imp
#

Is there a way to pull the data from the "Fields" and input it into the JS section? I'm not much of a coder, and I've been trying to figure it out and I think I'm missing something.

viral patrol
#

The easiest way is to use something like

let fieldData;
window.addEventListener('onWidgetLoad', function (obj) {
    fieldData = obj.detail.fieldData;
});

Then you will have all fields data in fieldData object. This method doesn't work for Alertboxes, so you should use templating variables like {textInput} or {backgroundColor} that are evaluated to values on widget load (they work as well in custom widget and in HTML/CSS/JS).

urban ivy
#

Hey! I wanted to do a small widget, can we use React?

rugged imp
#

@viral patrol That did it. Thank you!

rugged imp
#

I have this working via arrays, but I'd like to try and get it done via the fields to make it easier to edit, modify and update.
I'm creating a boss list that will track if its been defeated/not defeated and shown on screen. The idea is that the fields will say how many bosses there are, the boss names, and their status.
What I'd like to do is have the code check to see how many bosses there are, and then iterate through the list, adding each boss to the screen until it hits NumberOfBosses and stop. I have it done via an array with a for loop. But I cant seem to get an idea how to do it utilizing the fields

rugged imp
#

Since it appears I cant use json arrays, unless I'm missing how to

mild cipher
#

@urban ivy I'd say yes, but it's probably overkill for a 'small widget' LULW

urban ivy
#

I know, but it's so faster than pure js lol

mild cipher
#

Well, React consists of JS, so I'd argue that it could only be as fast as JS is lol

urban ivy
#

Sorry, I meant that it's faster to write in TS instead of pure JS lol

elfin arch
#

@rugged imp you could create a fields for each boss using unique names. the status of the bosses would always be true (when the widget loads or reloads it would restart). i don't think you can save back to the field data as the game progresses

elfin arch
#

if your field names were like "boss name 1", "boss name 2", etc... you could grab the fieldData object mentioned above and get the keys from it.

let fields = Object.keys(obj.detail.fieldData);

then filter/map/foreach that array to build your master boss list.

let bossKeys = fields.filter( i => return i.startsWith("boss name");
//['boss name 1', 'boss name 2']
let bossData = []
bossKeys.forEach( i => {
    let bossObj = {
          bossName = obj.detail.fieldData[i],
          bossStatus = true,
          bossHP = 100
};
    bossData.push(bossObj);
});
// bossData should now be an array of objects
viral patrol
#

@acoustic mesa you should use item guid there

rugged imp
#

@elfin arch Let me try that, that was the part I've been struggling with trying to figure out. I can just update the data manually, which is fine by me. Its better than doing what I did before when I did something like this. I'm wanting to have to avoid hard coding boss1 = fielddata, boss2 fieldata, etc

rugged imp
#

Hmm, I might need to go back to basics..lol. I've completely broken my hack job of a code.

rugged imp
#

It should look something like this correct? If not, I might have to do it the long way until I learn more about JS.

  let bossKeys = fields.filter(i => return i.startsWith("Boss Name");
  let bossData = [];
  bossKeys.forEach(i => {
    let bossObj = {
      bossName = obj.detail.fieldData[i],
      bossStatus = "Undefeated"
    };
    bossData.push(bossObj);
  });
  addEvent(bossData[0].bossName, bossData[0].bossStatus);```
mild cipher
#

Looks good! You might find map to be more useful. It's like forEach but returns an array

const bossData = Object.keys(obj.detail.fieldData).filter(name => name.startsWith('Boss Name')).map(boss => ({ name: obj.detail.fieldData[boss], status: 'Undefeated' }));
// [ { name: 'Foo', status: 'Undefeated' }, { name: 'Bar', status: 'Undefeated' } ]

addEvent(bossData[0].name, bossData[0].status);
rugged imp
#

Let me try that @mild cipher . For some reason the code I had posted isn't working. It doesn't seem to be displaying anything which is why I was checking to see if there was something I was missing

mild cipher
#

There are two small bits that are probably causing it, the return in your filter (this would only work if you wrapped it with curly braces), so you can take that out, and also your object's key-value assignment, should be { key: value } (and not { key = value } 😄

rugged imp
#

lol, that would probably do it! Yours definitely worked

#

You guys are awesome for helping me get this to work!

rugged imp
fossil prawn
#

Hoping someone here can help maybe. I am finally transferring all of my old ankhbot api commands over to SE and I have a command that returns all active bttv emotes in my channel which is ${customapi.https://twitch.center/customapi/bttvemotes?channel=tymestopper} but when I run it in SE it doesn't return all my bttv emotes is there another way around this or some built in command in SE that I am missing for this?

mild cipher
#

What error do you get?

fossil prawn
#

no error it just doesnt return all of them

honest pine
#

character limit?

mild cipher
#

Ah that'll be because messages are limited to 500 in twitch chat, and customapi responses are limited to 400 (for some reason)

fossil prawn
honest pine
#

ankhbot is still only returning the first 500 characters, and missing the last 82

fossil prawn
#

oh wait your right I see that now, I dont suppose there it a way around it with multiple commands or anything

honest pine
#

If you don't update the emotes you use in bttv often, put it in a pastebin/2 and return them

fossil prawn
#

ok I guess that will have to do for now thanks for the help!

viral patrol
#

You can use !emotes update and then !emotes bttv so it will show all your bttv emotes

fossil prawn
#

is that a built in command? It doesn't seem to work maybe I deactivated it somehow

rugged rapids
fossil prawn
#

ok we are just going to pretend like I didn't accidentally change the name of that command and couldn't find it 🤣 , thanks

#

fwiw that still doesn't return all emotes but its better than that I had

wintry pivot
viral patrol
#

Unfortunately not.

wintry pivot
#

Ok thank you for the reply. I see there is a built in widget "Labels -> Subscribers -> Latest -> Top Gifters list", do you know how that one works or is it possible to see the code of it?

pulsar willow
#

Please add INR currency in merch history records

high swallowBOT
#

@pulsar willow Check out the StreamElements ideas board: https://strms.net/ideas. You'll be able to add ideas, upvote ideas you agree with, and track their progress with email notifications. Adding and upvoting ideas also helps the staff know which ideas should be prioritized so please take some time to upvote.

viral patrol
#

@wintry pivot I think this is the only one possible ATM: https://api.streamelements.com/kappa/v2/widgets/:channelId/subscriber-gifts/leaderboard?limit=10&offset=0

wintry pivot
#

Perfect! thank you 🙂

compact swan
#

Do any of you guys know if a rotating metric is possible with Facebook Gaming? Ie. Latest follower, share etc etc

broken coyote
#

It is

pulsar willow
#

Hey, so I somehow can't change the amount to show in recent tips or cheers? I get this

indigo flume
#

known bug and reported to the devs

pulsar willow
#

okay thanks for letting me know rukiLove

viral patrol
#

You can click there and use arrow keys to adjust values as workaround

indigo flume
#

And it just got fixed by the devs pepeFix

main lodge
#

trying to figure out how to use the points api to make a custom command to get points, i know u can set custom command in SE bot but trying to do in my own bot but iam not good with api's

chrome saddle
#

@main lodge https://api.streamelements.com/kappa/v2/points/channelID/Name/Points(PUT) You will only change channelID to SE ID of the channel, Name of the person and Points to the ammount, for removing points you´ll use negative amount. And also you´ll need JWT token for Authorization, do you know how to do it?

main lodge
#

ive got a json file with the JWT token in

chrome saddle
#

@main lodge You want to source the JWT token from the json file?

main lodge
#

ive got the json file linked to the js file and in the api url i would link the SE account?

#

and where it says headers: {accept: SETTINGS.SE_JWTTOKEN}

#

'https://api.streamelements.com/kappa/v2/points/${SETTINGS.SE_ACCOUNTID}/${username}/Points' would this work to link the channel and the user who is using the command to check for currency?

viral patrol
#

It should not be accept, but authorization (also Bearer SETTINGS.SE_JWTTOKEN)

#

Second thing - it should be points lowercase

#

And if you use GET on that endpoint you will get user points

main lodge
#

so headers: {Authorization: SETTINGS.SE_JWTTOKEN}

#

you said about a bearer?

viral patrol
#

Yes. It should be like

headers: {Authorization: Bearer abcd123ef56abcd123ef56abcd123ef56abcd123ef56abcd123ef56abcd123ef56}
main lodge
#

does this work? headers: {Authorization: `Bearer ${SETTINGS.SE_JWTTOKEN}``}

#

ugh the ` were messing up the look of it

main lodge
#

so if its not accept but authorization whats the accept for in the api code on SE webpage for api's?

main lodge
#

yea still cant figure it out atm

viral patrol
#

@queen musk You can use it in html like <span class="animateme">{name}</span> And then create CSS animation for .animateme

#

@main lodge The best way is to use postman/advanced rest client and prepare calls there to check the structure. Then migrate it over to your app

main lodge
#

ive not heard of the advanced rest client?

viral patrol
main lodge
#

also with bearer does it need to be in ` with the auth in side as well?

elder dragon
#

How would i get all subs of the current month? Is there a way to do it using streamelements or should i use the twitch api?

viral patrol
elder dragon
#

I'd like to get the usernames

#

So i'm guessing api

main lodge
#

does the request url have to be http://api.streamelements.com/kappa/v2/channel/user/Points

viral patrol
#

Url should be https://api.streamelements.com/kappa/v2/points/:channelId/:username where. Replace :channelId with your channel ID and :username with desired username

main lodge
#

in that link it has about headers:{accept: `application.js} so where would the authorization be? would that be another line?

viral patrol
#

It should be second header in that request

#

As you can see on screen I pasted above

main lodge
#

so headers: {Authorization: Bearer ${SETTINGS.SE_JWTTOKEN}
,accept: application.js
}?

viral patrol
#

application/json

main lodge
#

does that make the body a json file?

viral patrol
#

Response will come as JSON, yes.

main lodge
#

ive got is as js and do a json.parse and that works but with it as json and not parse it doesnt let me get just the one item such as points

viral patrol
#

You should parse response, and then select value to display

main lodge
#

not sure how u mean? when i did var myobj = JSON.parse(body) when accept was application.js and that worked if i did myobj.points

viral patrol
#
const getPoints = (user) => {
    return new Promise((resolve) => {
        fetch(`https://api.streamelements.com/kappa/v2/points/${channelId}/${user}`, {
            headers: {
                Authorization: `Bearer ${jwt}`,
                accept: 'application/json'
            }
        }).then(response => response.json).then(resolve);
    })
}

getPoints('leeeeex').then(userPoints=>{
    console.log(userPoints);
})
#

Something like that

main lodge
#

ive got

if(message.toLowerCase() === '!slothbucks'){
  var request = require("request");

var options = {
  method: 'GET',
  url: `https://api.streamelements.com/kappa/v2/points/${SETTINGS.SE_ACCOUNTID}/${tags.username}`,
  headers: {Authorization: `Bearer ${SETTINGS.SE_JWTTOKEN}`
  ,accept: `application.js`
}
};
request(options, function (error, response, body) {
  if (error) throw new Error(error);
  var myobj = JSON.parse(body)
  client.say(channel,`@${tags.username} has ${myobj.points} slothbucks`);
});
}
#

iam using that tmi bot

grizzled pier
#

Hello guys
Where can I find the specification of the whole object you receive onWidgetLoad for a custom widget in a Mixer layout?
I am particularly looking at the inner workings of the obj.detail.recents objects
the only thing I see there is name and createdAt. I don't see the type of event or the amount for the event like sparks, embers, etc.
I need this in the context of an End Credits widget

#

all your help is kindly appreciated

viral patrol
#

@queen musk <video id="video" playsinline autoplay muted style="width:100%; height:100%"><source id="webm" src="{{video}}" type="video/webm"></video>

#

@grizzled pier some of Mixer events wont go through due to issues with Mixer API (I am pretty sure embers are affected with that). Then it should be embers-latest and sparks-latest

grizzled pier
#

Hello @viral patrol, thank you very much for taking your time to reply to my message.
I do get embers-latest and sparks-latest inside the session.data object however I was talking about the recents list. In other words, how do I get the name and number of followers during that particular streaming session?

viral patrol
#

Ohhh. Right. Checking it now but I don't see those events in recents.

broken coyote
#

the only recent event's you'll get is tips i do believe. atleast onLoad

fiery ocean
#

Need staff for stream elements

elfin arch
#

is it a general API question one of us can help ya with @fiery ocean ?

plucky hill
#

There is a way to know when someone spend channel points and what is buying?

hardy walrus
#

Other than that we have nothing else atm.

elfin arch
#

is there a listener* for Stream Elements point redemptions? just need a yes/no for future reference. not seeing it in the Widget Alert doc at first glance

plucky hill
#

@hardy walrus @elfin arch, I'm able to get list of point redemptions with SE_API.store.get('twitchCustomRewards') but as you say, it doesn't seems to have listener and onEventReceived isn't trigger if the point redemptions doesn't have text message.

Thanks for the info!

elfin arch
#

can an overlay send a message to Twitch chat?

viral patrol
#

@elfin arch only when you use external resource that handles message.

#

It is not possible directly

#

You can use a middleware to send message as SE bot via sending POST request to /bot/:channelId/say

elfin arch
#

so, not like in the overlay editor. i can't send a client.say(....) back from a message

viral patrol
#

You can use client.say(), but only if you have tmi/twitchjs in your widget that is authenticated against Twitch API.

elfin arch
#

thanks. i don't wanna put tokens in the overlay code, was hoping there was an 'echo' back or something. but that makes sense

elfin arch
#

how can i can export a widget for someone else to import

rugged rapids
#

They can give you an editor access to their account and you can copy overlays between accounts then.

primal halo
#

Ayup, where do I make a custom widget?

viral patrol
#

Hello in our cave

#

You can create a custom widget in overlay

#

Documentation for that is in channels topic

primal halo
#

Dope thank you!

viral patrol
#

Also the CustomWidget.md is in same repo as example widgets. So you can have a head start there 😉

primal halo
#

I'm guessing I don't need any HTML, CSS or Fields for this to operate in chat?

viral patrol
#

No problem at all.

#

Glad I could help. OK. Calling it a day. If you have any further questions, I will be back in few hours (and in meantime there are some of our extraordinary gurus too).

primal halo
#

Sleep tight!

viral patrol
#

Will do. Thanks!

viral patrol
#

OK. I had to come back and write - there was an issue with twitch items gathering via my widget. It is fixed now.

glass grotto
#

any reason why the request returns

{'statusCode': 404, 'error': 'Not Found', 'message': 'No channel was found'}

This happens every now and then

primal halo
#

It says it all right there?

#

No channel was found

glass grotto
#

...

#

I said it happens every now and then

#

Im using same channel everytime

#

Its clearly some issue with the api, code doesnt change

#

Is there like a ratelimit?

fallen magnet
#

Any documentation to connect to the websocket using c# ? 💜 I want to do custom things outside of streamelements when someone follows etc.

glass grotto
#

nvm streamelemts web page was down

fallen magnet
#

I am not sure how to authenticate 🤦‍♀️

fallen magnet
#

Got it 😄 webSocket.Send("42["authenticate" ,{"method":"jwt", "token": "" + token + ""}]"); Big oof.

void olive
#

Hello. I made a new customer follower alert that is 1920x1080. exported to WEBM so its transparent and will work with your site. But it is being scaled down to a much smaller size
I set the alert box to 1920x1080, same as overlay and stream and everything
It is my logo that swirls in from left, and exits right. I need it to be full screen. HELP!!

#

EVERYONE: if you have this issue use text over image........ figured it out. maybe other people need the help

rugged rapids
#

@old belfry Do not share overlay URLs.

elfin arch
#

is it possible to store data back to the fields for an overlay? ...

#

(pretty sure i know the answer is no... but thought i'd ask)

viral patrol
#

Can you rephrase that or write a scenario? I am not sure what you asked about

elfin arch
#

good morning/evening lx

#

can the logic in the JS change that to "Yes" and save it for the next time the overlay loads.

viral patrol
#

Unfortunately no. Overlay can store values in SE_API.store() and you can override that setting in widget config

karmic zenith
#

Hey guys - i am trying to get response from https://docs.streamelements.com/reference/filters#botfilterstestbychannelpost

I've tried to simply POST the message as a string for the body param
also to post as an object and array with the structure
obj = {username: username, message: message}
since when getting "List filters" from api, it has a Key called "runsOn" with value ["username","message"]

i feel no matter what i pass, i keep getting
id: <with the msg id>
error: null
processingTimeMS: <whatever small amount of time it takes>
and the
match: null

even though the message passed to the body param matches the filter

#

what am i doing wrong?

#

It's a custom "banned phrases" - doesn't it support that?

elfin arch
#

which endpoint are you trying to target? and can you post your sample code?

#

..... also the header needs the 'bearer JWT token' which isn't shown well in the docs

karmic zenith
#

it got all the correct headers

#

i know that, since i get the result

#

id: <with the msg id>
error: null
processingTimeMS: <whatever small amount of time it takes>
and the
match: null

#

with method "POST"

#

headers: {'authorization': Bearer ${settings.jwt},
'accept': 'application/json'}

#
  • {'content-type': 'text/plain'}
#

to pass the string as text ofcourse

#

i believe it's the format of the string i'm passing if anything
which i've tried loads of things as stated above

elfin arch
#

i've not tried to hit that endpoint. not sure if filter is 'filter'/id#/'name'

#
https://api.streamelements.com/kappa/v2/bot/filters/${channelID}/${test-message}"
``` ??
karmic zenith
#

i don't know about the "/${test-message}" but the "channelID" is passed aswell

#

the ${test-message} is passed as a Body in Fetch API

#
> try{
    const response = await fetch(api.url, {
      method: api.method || 'GET',
      ... (headers && { headers: {...headers, ...api.headers} || headers }),
      ...(body && { body:body })
    });
> ``` ??
#

as i stated multiple times .. i DO get a response, so it's neither url or headers

#

im sure it's the format

#

probably needs an object or array with certain keys

#

i also tried to pass both an object and array with keys: "username, message" and also tried JSON.stringify'ed them

elfin arch
#

ya. method = "PUT" ?

karmic zenith
#

no = POST

#

again, i think you misunderstand what i say.
i DO get a response 200 - but i can not get it to match the phrase, even though it does match

viral patrol
#
fetch(`https://api.streamelements.com/kappa/v2/bot/filters/${channelId}/test/`, {
  "headers": {
    "accept": "application/json, text/plain, */*",
    "authorization": "Bearer Token",
    "cache-control": "no-cache",
    "content-type": "application/json;charset=UTF-8",

  },
  "body": "{\"origin\":\"bot\",\"data\":{\"username\":\"qwe\",\"message\":\"qwe456\"}}",
  "method": "POST",
});
karmic zenith
#

cool, how did u find the body keys?

elfin arch
#

ya. sorry. i missed the whole part about you getting a res back.

karmic zenith
#

@viral patrol does it need the origin?

#

@viral patrol passing as "content-type": "application/json" was what worked
how did you find out what keys it needed?

viral patrol
#

Ohhh. I was preparing documentation some time ago and some of parts were lost on conversion to current version 😉

#

So if you have any questions regarding our API - you can hit me.

karmic zenith
#

@viral patrol awesome - great to know that there's parts missing 🙂 hopefully you guys will get to updating it in the soon future 🙂

elfin arch
#

i searched the Discord and that is first time i've seen that endpoint mentioned.... didn't even know it existed tbh. whatcha building Emwe 🤔

karmic zenith
#

@elfin arch i mean, i could just match up against "https://api.streamelements.com/kappa/v2/bot/filters/channel"
and get a list of all filters
however getting an instant match from your api seemed faster :D
my endgoal of what i'm trying to build, i'd like to keep to myself since it could create income, but i can tell that i'm currently working on Overlay-Command-Info-Alerts (such as shoutout etc) which is why i need to check for banned phrases, for one 🙂

elfin arch
#

gotcha... just curious. i'm not SE BTW, i'm a non-role and been learning the SE/API/OVERAY for just a few weeks. only trust the red/blue names, but the non-roles do try to help 😜

karmic zenith
#

@elfin arch haha all good - i also appreciate the fast reply! any help is appreciated!

elfin arch
#

... and i still honestly don't know why that is a post request to check a filter?

karmic zenith
#

@elfin arch you dont "PUT" any information since it's a function that throws the information after it gives a reply

#

probably !

#

i'm no expert - just a simple guess

#

maybe it's about the format? could be that PUT is better at parsing strings rather than stringified objects?

elfin arch
#

not sure? normally a put/post is like 'save' data?

karmic zenith
#

so what kind of response do you get from your regular PUTs? i haven't used a PUT endpoint yet, but if that's just a "true/false" response, that might be why. since this endpoint gives an object like a GET

viral patrol
#

POST is a message sent to server to create a new entity, PUT is to update one usually.

elfin arch
#

generally like the 'save points' and get a 'yup it saved' or 'nope didnt save' (for GET)

viral patrol
#

But currently people use GET/POST only in most case

karmic zenith
#

@viral patrol i'll do whatever the API tells me 😄

#

@elfin arch u mean for PUT?

viral patrol
#

Don't do whatever API tells you. This is how Machine Riot can start!

elfin arch
#

errr. yes both GET/PUT**********

karmic zenith
#

@viral patrol hah right on

#

@elfin arch yea, so i think that's the reason 🙂

elfin arch
#

... i do have to ask. why don't you get the filters and run them locally?

karmic zenith
#

lazyness?

elfin arch
#

like if you were to try to hit the API for each message... you'd get rate-limited maybe?

#

but there is a delay too

karmic zenith
#

oh

#

that's a good point!

#

i believe i read a 60-100 hits per second tho somewhere

#

but you're right about passing all filters in and save them as a variable would be both safer and faster.

elfin arch
#

yup. it'd be better to load the filters and use them locally.

karmic zenith
#

hmm, i'd have to make a polling to ensure if they changed though

#

i guess there's no way around that

elfin arch
#

unless your expecting the filters to change mid-stream (then maybe do a timer) ^^

karmic zenith
#

wouldn't need to be a fast polling - every 5-10 minutes would suffice

elfin arch
#

depends on what your secret project is 🙂 .... is it checking every message or every alert?

karmic zenith
#

it's only checking when a command or keyword is mentioned

#

and i'm gonna take the command cooldowns into account aswell - will have atleast a 5min cooldown per user and atleast 2min global

elfin arch
#

are you building this server-side? i'd assume.

#

like for multiple people or just a single self-host?

karmic zenith
#

the script is hosted on my end, but it's ran in the Custom Widget section - working together with both the overlay and the chat 😉

elfin arch
#

i just finished my first widget myself

#

and it reads chat 🙂

karmic zenith
#

nice! what have you build? 😄

elfin arch
#

for client-side? a few bots Twitch/Discord

#

but trying to move it all to the the SE overlay editor and run all the code there

karmic zenith
#

huh - so the bots is also js?

#

ooh - so u had your own link that you put in obs

elfin arch
#

ya. you can build a lot in the Overlay editor

karmic zenith
#

oh yea !

#

best api of all alert/bot services !

viral patrol
#

And soon(tm) there's something nice coming

#

Stay tuned 😉

karmic zenith
#

@viral patrol awesome! can't wait

elfin arch
#

trying to make a video... but meh...

hardy walrus
#

Rather flashy file ya got there

elfin arch
#

🤣 i donno what else to use for screen grabs.

#

i got paint and .... that for 2001 style

broken coyote
#

Swf? Talk about a flash back

hardy walrus
elfin arch
#

don't hate. you'll have I.E. and it will work

#

flash off

broken coyote
lusty portal
#

Is anyone interested in a commission to make a widget that I can put in multiple goals into and have the goal update to the new goal when the previous one is completed? This should also be able to trigger a scene in OBS if possible.

elfin arch
#

can you do a hand drawing / paint of what you want? (and for the goals)

lusty portal
#

So you know the follow/cheer/subscriber goals that are default?

#

I just want to be able to put in 5,10,20,40,80 or something and when it hits 5, the goal updates to 10.

elfin arch
lusty portal
#

I thought commissions was for people offering to do things, not the other way around.

#

My bad. I'll try there.

gritty aurora
#

It is, you contact the people individually

elfin arch
#

you'd have to DM someone that posted there

lusty portal
#

Ah.. ok

elfin arch
#

but, posting here for free service is fair game as well 🙂

native trellis
#

for questions about custom widgets we send people here

#

because the code-gurus are in this channel 😉

elfin arch
#

is a widget/overlay the same thing?

native trellis
#

no

#

on overlay is usually just the graphical part if we are looking at the #art-marketplace side of it

#

the widgets are more coding

lusty portal
#

Ah.. ok.. Well, I pinged 2 of them to ask if they can do coding on the overlays.

#

So... Anyone interested? If you insist on doing it for free, then so be it.. But I'd rather pay you for it.

gritty aurora
#

What do you mean by "trigger scene" in obs?

lusty portal
#

Use the sockets for OBS to trigger a scene.. But a chat message saying it was completed would work as well.

elfin arch
#

do you mean an actual "scene' in OBS ... like 'brb' screen or like an overlay pop-up?

lusty portal
#

Yes

#

But like I said, that's optional. A message in chat would be fine.

#

Not sure why you are laughing.

#

It's possible to be done with OBS Web Socket plugin.

elfin arch
#

i was asking whether you wanted an OBS scene OR overlay pop-up ... and you said yes.

#

it was a this or that, and you said yes... sorry, i found it funny* 🙂

lusty portal
#

Ah.. The widget would update the goals. So it would update the widget that I'm displaying as an overlay.

#

If it can send an OBS web socket call, that would be nice.. Though like I said, a custom word in chat would work as well (as my bot can use that to trigger the scene change locally)

#

The main focus would be to have it change the goal when the previous goal is reached.

gritty aurora
#

it wouldn't be hard to make but i'm very busy at the moment i'm sorry!

lusty portal
#

I understand. I don't mind waiting if you want to work on it later...

#

How much would you charge?

gritty aurora
#

don't have any experience with commisioned work.

lusty portal
#

Would $20 be reasonable?

native trellis
#

would be better if you sort this in DM's 😉

lusty portal
#

Yeah.. Sorry @native trellis

gritty aurora
#

20 usd would be reasonable by my standard but i'm busy right now ^^

#

sorry mods :)

elfin arch
#

...and we lost dennis to the darkside.

native trellis
viral patrol
#

I had to come here (I am watching a movie with wife and during a break I took my phone)

#

This one has "autoIncrement" in custom fields

#

And price for that would be $0.00 net. I hope you are OK with that

lusty portal
#

LOL.. I am. Thank you.

broken coyote
elfin arch
#

i just wanna know what movie ya'll watching?

broken coyote
#

I’m hoping it’s something with chuck norris in it

native trellis
lusty portal
#

@viral patrol It doesn't seem to make a line entry, but this is a good place to play with something and see if I can work it out. Thank you again. 🙂

viral patrol
#

@elfin arch I am watching a Good Doctor (US TV series)

keen bison
#

how can i get in contact with a developer that can help me with an issue?

high swallowBOT
gritty aurora
#

Hey I have the following code in my js:

SE_API.store.set("testing", {test: "testing"}).then(()=>{console.log("test123")});

but the log never fires. Does the .set() method ever resolve?

viral patrol
#

You are right. This is a Promise that never resolves.

hardy walrus
#

#BrokenPromises

viral patrol
#

It is going to be fixed soon. Promises can't be broken <3.

#

And I broke a heart... Well played me.

dry wyvern
#

Not Too sure where to post this. So I'll put it here.. Since we have The Social Media currently with only the ability to put in text. Has there been any considerations to allow adding in GIF/Video/Still Images To Social Media That We can configure for when we go live?

rugged rapids
#

Use the Asset rotator/slideshow widget in the static/custom category for this.

main lodge
#

hey guys iam trying to make a global cooldown for command but cnat seem to get the counter to stop going up

if(message.toLowerCase().startsWith("!hey")){
    
    function clear(){
      clearInterval(timercount)}

    function timer(){
      seconds++
    }
    if(seconds == 0){
    var timercount = setInterval(timer,1000)
    timer()}
    else if(seconds> 0 && seconds<5){
      client.say(channel,`command incooldown `)
    }
    else if(seconds> 5){
      clear()

    }
  }
viral patrol
#

You have problem with scoping there. interval is not persistent on another onEventReceived call

#

I would move

let timercount,seconds=0;

function clear() {
    clearInterval(timercount)
}

function timer() {
    seconds++
}

to the main scope. and then replace

    var timercount = setInterval(timer,1000)

with

    timercount = setInterval(timer,1000)
main lodge
#

i tried doin that but dont work

var timercount = null
function timer(){
  seconds++
}
function clear(){
      clearInterval(timercount)}
  if(message.toLowerCase().startsWith("!hey")){
    
    if(seconds == 0){
    timercount = setInterval(timer,1000)
    timer()}
    else if(seconds> 0 && seconds<5){
      client.say(channel,`command incooldown `)
    }
    else if(seconds> 5){
      clear()

    }
  }
viral patrol
#

Can you give me bigger part of code?

#

Is timercount wrapped in another function? like client.on()?

main lodge
#

yea it is

viral patrol
#

You need to put timercount init above that

main lodge
#

i did this but still doesnt work?

let seconds = 0
var timercount = null
client.on("message", (channel, tags, message, self,) => {
    // Don't listen to my own messages..
    if (self) return;
    // Do your stuff.

function timer(){
  seconds++
}
function clear(){
      clearInterval(timercount)}
  if(message.toLowerCase().startsWith("!hey")){
    
    if(seconds == 0){
    timercount = setInterval(timer,1000)
    timer()}
    else if(seconds> 0 && seconds<5){
      client.say(channel,`command incooldown `)
    }
    else if(seconds> 5){
      clear()

    }
  }
#

even with the functions outside the client.on still dont stop the counter going up

gritty aurora
#

any possible eta on the .set() promise-fix?

viral patrol
#

@gritty aurora it should be fixed already (but I am not sure if it is deployed already).

gritty aurora
#

let me fire it up

viral patrol
#

🤞

gritty aurora
#

it did!

#

thank u!

viral patrol
#

@main lodge You may want to add some console.log(seconds) or other stuff, so you know how logic goes within this block of code

main lodge
#

all i know is the counter works and goes up but i cant stop the interval

main lodge
#

yep still cnat stop the counter goin up whether i use setinterval or settimeout

viral patrol
#

and does your code go into else if (seconds>5) ?

main lodge
#

by do u mean does it go into it do u mean does it get a response once seconds is over 5s?

#

only if i call the command again

#

hmm, if i call the command again it does act on the clear...

#

ok so its because the when the command is called in chat it checks the first if and once that happens it no longer checks the else if's until called again...

#

it works with a if statement outside checking for the cooldown, would mean i would hav to make a var for each cooldown though as dont hav long left today to finish up, can make it better after this week as its final week of course

viral patrol
#

Also you never reset seconds

function timer(){
  seconds++;
  if (seconds>5) {
    seconds=0;
    clear();
  }
}

I would do that even within that function

main lodge
#

oh it does... its so simple it makes me laugh at the many hours ive spent over the past couple days trying to get it all work

gritty aurora
#

Hey I'm currently running into race condition problems with the SE_API.store db. I have an event listener set up that increments a value. Of course you would have to get and set. How would you handle this if the event fires faster than the db can respond?

#
window.addEventListener('onEventReceived', function(obj) {
  const data = obj.detail.event;
  if (data.listener === 'cheer-latest' && fieldData.goalType === 'bits') {
      incrementData(data.event["amount"], fieldData.goalType);
  }
}
function incrementData(amount, goalType) {
    getData(goalType).then(oldData => {
          oldData.progress += amount;
          sendData(oldData, goalType).then(() => { handleGoal() });
 });
}

getData is just SE_API.store.get(type) wrapped in a Promise, same goes for setData. handleGoal() basically just calls getData and translates the data to the html

#

goalType is because the widget can be used for cheers/subs/tips/follows. Now I'm just testing bits

high swallowBOT
#

@cursive herald Please follow our community rules:

  • No advertisement or stream promotion
  • Respect ALL server members
  • No NSFW/NSFL

Thank you

stone marten
#

Hey gang, I updated the social media rotator widget to include patreon and discord options. Is there a way to PR and contribute this back? I didn't see it in the github

hardy walrus
#

@viral patrol ablobthinking

viral patrol
#

I think that the best way is to reach @rugged rapids as it is his widget 😉

#

I may be wrong, as there were several rotators

stone marten
#

the one thats on the page under Themes in the Widgets tab

viral patrol
#

So yup. It is Benno who maintains it

stone marten
#

It's the same thing, just added additional event options with some pre-config options for Discord and Patreon in the rotator. @rugged rapids if you'd like to add it, happy to contribute

#

thanks dudes

rugged rapids
#

@stone marten Send you a DM.

ocean glacier
#

If I use Top Donation widget on streamelements

#

Will donations from streamlabs update that?

rugged rapids
#

No.

#

Only tips made through our tipping link will update our widgets.

glad perch
#

hello, is there somebody who wants to help me by making a custom media request widget? thanks in advance

karmic bay
#

I was looking at the Charity trackers for the SE overlays and they leave a little to be desired. Is there a way to include/add the tracker from the Charity into the overlay it self, or find a way make a custom widget? cause I am really not in the mood to "clean out" all my OBS scenes right now XP

broken coyote
#

@glad perch I will deff give you a A for effort ol bub. You are definitely persistent

shut crescent
#

@broken coyote we can take comissions right? ;P

broken coyote
#

we? @shut crescent

shut crescent
#

developers

#

Was just joking, considering @glad perch is so persistent in asking for help.

broken coyote
#

oh. yea. i havent seen somebody make one of those. i know @steady iron tried and they ran into some kind of roadblock

karmic bay
#

from what I know about the SE widget's... wouldn't it be easier or more stright forward to develop a song request bot? 🤔

velvet cave
#

our bot already takes those requests

karmic bay
#

excatly, but it was more of a reverse question to the "custom media request widget" thing, if said widget is sepposed to work standalone without the SE bot, "wouldn't it be less work to just make anohter bot, even if redundant?" kind of question awnser.

signal latch
#

Hey any way to make a comand on streamelements that counts upward from the first time a user uses the command but it only counts up for them? for example if user1 did !count it would say 1 and then if user2 did !count it would say 1

viral patrol
#

$(count $(sender)_deaths) should create a separate death counter for each chat user

elfin arch
#

...sidebar to that question in Twitch chat "Hello 😉 How to add last sub avatar to overlay? I had last sub name but i want to add his avatar."

how can you store the Avatar image between sessions/reloads? is that where SE_API.store comes in?

viral patrol
#

You don't have to

#

GET https://decapi.me/twitch/avatar/:user will return you avatar URL for specified user

#

You still have latest user in session data, then just call it on load/update

elfin arch
#

oh ya. get it on load. ... but let's say i wanted to save an object between sessions, could the SE_API.store used for that.

viral patrol
#

You can store any value between sessions/widgets within single account using SE_API.store

pulsar willow
#

lx, I tried that. But it doesn't seem to work. The chat response I got is:
GenericJoe has died! Total death count: $(count $(sender)_death).

viral patrol
#

Oh. I think I used wrong brackets...${count ${sender}_death}

#

Or just remove _death part maybe

pulsar willow
#

Same result with { and }. I tried removing _death then it works. But I cannot create more "unique commands" to a user.

pulsar willow
#

Alright, after some trail and errors I got it working. You need " around the counter name. ${count "${sender}_death"} then it works. The only problem I have found is that the default command !editcounter does not work. Maybe a bug?

#

You need to create a custom command to change the counter.

elfin arch
#

you could try to chain it all together with ${count <countername> <name> <value>} .... create a custom !counteredit nameofcounter pjponp 50 -> ${count ${args[1}${args[2] ${args[3}}*

#

or if you for say have just a "Kappa counter" then !kappacounteredit pjponp 50 -> ${count ${args[1]_kappaccounter} ${args[2}}

pulsar willow
#

Yeah, I ended up doing something simiular, the " around were needed too.
!setdeath => ${count "${1}_death" ${2}}

elfin arch
#

oh. ya; you are correct; it's just ${1} ... etc... nice 🙂 not sure why the " quotes are needed though 🤔

pulsar willow
#

Neither do I, If I skip them, it just output command as text.

hoary gulch
#

I've been working on a !steal command to steal a random configurable % of target user's loyalty points and I did get it to work. However, due to limitations of SE bot it requires a bit of help from Nightbot to pull of. End result is 6 lines of bot spam in the chat.

This won't do, so could we just have an API level way of doing this with 1 custom command and 1 bot pls?

Something like !steal -> ${steal.user.points} which would result in Sender getting set amount of points from target User

And to customize we could do for example:
!steal -> ${steal.user.points ${random.1-100}}
Which would result in target user getting 1 to 100 of target user's points.

Also. Why can't we save keywords to Default SE bot commands?

elfin arch
#

not sure why you are pulling nightBot into this... are you working on a local bot or wanting it all cloud-side ?

hoary gulch
#

Might help if I just paste in what I have. This is all done in the cloud

elfin arch
#

that could help; it sounds almost like the !duel command with more flair.

hoary gulch
#

This is what a user types in SE bot to start things off with:
!steal ->
!set ${user ${1}} ${count points ${customapi.<code>https://twitch.center/customapi/math?expr=round(${user.points}-${user.points}*${random.1-100}/100)} ${2}} ${sender} Gets ${customapi.https://twitch.center/customapi/math?expr=${user.points}-${getcount points}}

Next this happens on Nightbot:
!set ->
!setpoints $(1) $(2) !give $(3) $(5)

Back to SE bot:
!give (<-This would be a keyword in the default commands !setpoints and !addpoints if we could save those miiliFine )
->
${3} ${4: }

Back again to Nightbot:
!give ->
!addpoints $(1) $(2)

Edit: Changed rounding so that SE bot does it and Nightbot just bounces back mod only bot commands now.

#

End result looks like this:

elfin arch
hoary gulch
#

I just don't see a simpler way of doing this a the bot is atm

elfin arch
#

i gotta ask @viral patrol

hoary gulch
#

Obv this would not do on the actual channel I'm making this for

elfin arch
#

i know easier ways; but what you have done is honestly impressive...

hoary gulch
#

It's a mess

#

I suppose there is a bot witch can do this but I really would prefer to do as much as possible on SE only

elfin arch
#

and to be clear, you are trying to update the SE points this whole time?

hoary gulch
#

Basically yes. This just transfers them from user A to user B

elfin arch
#

i'm actually impressed in you bot back-to-back chat

hoary gulch
#

Updated the first bit. Discord didn't like my code as it was..

elfin arch
#

doing this client side would be much easier. with like Node instead of juggling the bot commands

hoary gulch
#

This all has to happen with cloud bots

#

If SE supported chaining commands or whispering to other users than Sender. This would be so much cleaner

elfin arch
#

i haven't seen the source, but my 80% guess it the code will stop when it gets to the first command. (unless you tried like you mentioned way before an use the keywords)

#

but that wouldn't stop the command spam

hoary gulch
#

I have tried multiple commands but it always picks up just the first command

#

Keywords somewhat solve that but again. Can't save them to Default commands for whatever reason

elfin arch
#

if you can try to work your logic out in Node or JS that might be amount of time spent.

#

then you can build an overlay to run all of the JS logic

hoary gulch
#

I tried my hand at making API calls with that ${customapi} tag but I don't know enough about this stuff to use the SE API

elfin arch
#

you won't be able to get past the "auto responses" on S.E. side when those bots play the chat game back and forth

hoary gulch
#

How would running JS in an overlay work? That seems like an option to explore.

elfin arch
#

i guess i'm trying to suggest/say... can you build this in JS ? like as an overlay/widget. then wait for lx to help with the se integration parts

#

you build an overlay that just basically just runs the "read chat" part

#

then you could make flashy graphics if you wanted with the HTML/CSS

hoary gulch
#

That's not needed. This is just a stupid thing to run in chat

elfin arch
#

🤣 complicated stupid .... really sounds like a custom !duel command

hoary gulch
#

I don't think I can make the logic in JS but with help from my buddy. Probably could do it. But that's assuming it's even possible to get all of that point info directly from the SE API to a custom Java Script and then spit out the results in chat

elfin arch
#

If you can hold off a few hours or maybe a day or 2. It might be a route then your chatbot ping-pong match 🙂

#

...although, again, quite impressive

hoary gulch
#

I'm really not in a hurry with this. Thanks for appreciating my mess LUL

#

Although I noticed I messed up something with the initial part. It's supposed to take 1 to 100% of target users points and spit out how many points the target user has left to Nightbot but if a user has a point value which isn't divisible by 100. The first bit flat out fails.

unreal kestrel
#

Hey, lx. Quick question about the scene switching widget you built. It should be like this for each scene that it's in, right?

#

I don't remember what I was doing when I first set it up and it had a hiccup so I went through all the sources and noticed "refresh browser" unchecked in one. It fixed it so I'm thinking I am right just wanted to double check.

#

Visibility/Layer level should have no bearing, right?

#

It's either that's what caused the hiccup or one other thing but I gotta verify some things before I finalize that second theory so I am hoping it was the fact that I forgot to check refresh source.

visual lava
#

I have a question that I asked in the Twitch help, but I suspect its API related if anyone wants to answer a quick question.

viral patrol
#

@unreal kestrel The best way is to keep it on separate overlay so it won't trigger any function more than once. That browser source should have "Shutdown source when not visible" unticked. "Refresh browser source" may be unticked too, but I think it doesn't matter

#

@visual lava Please provide a question, so when somebody is around with answer, you will get it 😉

visual lava
#

Sorry about that, forgot to "up my game" in the more precise chat 🙂

#

So a streamer I support is doing a sponsored stream through Stream Elements. There is a widget that displays an animation and the name of the person who Downloaded the game and met the required conditions. My question is, is there a log in either the OBS or the Stream Elements dashboard that logs those events, so you can see them after the fact?

unreal kestrel
#

Roger, yeah I've got it as a separate browser source on every scene.

viral patrol
#

@visual lava Those events should be displayed in Activity Feed

visual lava
#

@viral patrol So I checked the activity feed, and it did not seem to show events from this particular widget, just normal Twitch events like follows/subs/donations

viral patrol
#

What is the streamer's name?

simple cove
#

Is there something like a Bank Heist feature available to people? I have been looking around but google is being mean!

viral patrol
#

@simple cove Stay tuned. I hope we will have something pretty close and nice for you soon (TBA @ #widget-share )

swift birch
#

I can't seem to turn off community gift for some reason. Is there a way to turn it off using else if (event.amount === 'community gift') {
null
}
or something?

elfin arch
#

for the alert box @swift birch ? ... i played with it and it seems that if the community gift is disabled/removed it will default down to sub gift. i can't find where to edit the JS but something like like might work? i was able to cheese with removing all settings basically

swift birch
#

@elfin arch Thanks for the reply! I did that but didn't like that it was a little clunky... BUT I FIGURED IT OUT! I just removed the video source in the html code and set it to enabled. Fixed my issue haha. Hope this could help you out too!

elfin arch
#

good work! are you using the default Alert box? ... i couldn't for the life of my find the edit code option

pulsar willow
#

got a question. what's the proper format for passing a bearer token?

#

i've tried

headers = {'accept': 'application/json',
           'Authorization': f'Bearer: {jwt}'}

and

headers = {'accept': 'application/json',
           'Authorization': f"Bearer: '{jwt}'"}
#

also with and without colon in the header value

#

No matter what I try, I'm getting a 403

#

@ me if you respond :3

#

that being said, the /channels/xxx endpoint works. does the leaderboard need OAuth or..? I'm trying this on my own channel

mild cipher
#

A 403 error probably means you're accessing an invalid path. Are you using the SE channel ID rather than the channel name?

pulsar willow
#

403 = Forbidden tho?

#

and yea, i'm using channel id

#

/channels/xxxx works, but /tips/xxxx/leaderboard 403's

#

it seems channels/ works no matter what you pass as a token

mild cipher
#

Incorrect authorisation would be 401 Unauthorised. What does your whole call look like?

pulsar willow
#
url = f"https://api.streamelements.com/kappa/v2/channels/{channel}/"

headers = {'accept': 'application/json',
           'Authorization': f'Bearer {jwt}'}

response = requests.request("GET", url, headers=headers)
print(response.text)
#

and channel is my SE channel ID

#
url = f"https://api.streamelements.com/kappa/v2/tips/{channel}/leaderboard"

headers = {'accept': 'application/json',
           'Authorization': f'Bearer {jwt}'}

response = requests.request("GET", url, headers=headers)
print(response.text)
#

this ^^^^ 403's

#

I tried "Bearer 'xxxx'" as the doc said and also Bearer xxxx as the guide said

#

I've also tried changing my user agent, and that didnt work =/

mild cipher
#

I can't access the endpoint either, I think the docs are outdated. You can get top tips by listing all tips or by /top and aggregate them yourself

#

From what I understand the docs are still WIP

pulsar willow
#

oh. is there a endpoint of enpoints? like, something I can call to get valid endpoints?

mild cipher
#

Mm not that I'm aware of :/

pulsar willow
#

dang.

#

i'm also guessing I need to make a manager invite link and send it to the owner of the channel I'm accessing?

#

or..how does channel auth work?

mild cipher
#

I believe tips can only be retrieved using JWT, which you won't have access to even as a manager on another channel, or by oauth2 with the tips:read scope

pulsar willow
#

I did that, and am wating on a reply

mild cipher
#

I'm fairly sure that's through the site, but tokens are bound to the account, so the API is something else

pulsar willow
#

ahh alright

#

how long does an application take to get approved, on average?

mild cipher
#

Not sure! I think they go out in batches every 2-4 weeks? depends on when the last batch was

pulsar willow
#

welp that just delayed this project :S ty tho!

ivory marsh
#

Working on a command that I want to do some basic math of variables a, b and then multiply by 100 to get a percentage. Saw some others with commands that used ${eval} but that doesn't seem to work anymore. Anyone have a direction they could point me in?

hardy walrus
#

@ivory marsh actually got a custom API for some funky math. Gimme a sec to find it.

#

Well not me personally.

#

@ivory marsh How exactly does the variables work into it?

ivory marsh
#

Given variablenames var1 var2, it's be like
(var1 / var2) * 100

hardy walrus
#

Mind giving an example?

ivory marsh
#

!cmd add !lives ChatterChats is at ${getcount deaths} deaths. He is currently at ((${getcount deaths}/${getcount lives})*100)% life remaining

high swallowBOT
#

You can make changes to custom commands in chat with !command add/remove/edit/options/show Valid flags for !cmd options are: -enable -disable -cd (number) -usercd (number) -cost (number) -level (number) -type (say, whisper or reply) -count (number). --- Example: !cmd options twitter -usercd 60 -type reply -level 250

ivory marsh
#

That's what I got so far

hardy walrus
#

Oh

#

Gimme a sec. That should be hella easy.

#

{customapi.https://twitch.center/customapi/math?expr=(${getcount deaths}/${getcount lives})*100}

ivory marsh
#

That works perfect, thank you!
❤️ 🧡 💛 💚 💙 💜 🖤 🤍

ivory marsh
#

Another question for incrementing variables, say I want to add multiple deaths without spamming the chat (If my mods or I get behind), I have ${count deaths +${1}} but it isn't working and is just displaying ${count deaths +$(1)} instead of actually incrementing it. Probably syntax for it that I'm missing but figured y'all might now

#

Addendum to that, is there a way for it to take an input or default to one, so I can just had !adddeaths and either put in like !adddeaths 5 to add 5 deaths or !adddeaths to just increment by 1?

rugged rapids
#

Use ${count deaths '+$(1)'}

ivory marsh
#

Awesome! Thank y'all so much for the help ❤️

swift birch
#

Is there any way to make an alert longer than 60s? Looking to have a subtrain animation countdown bar that lasts 300s.

rugged rapids
#

Afaik there is not with the standard alert box widget.

swift birch
#

Yeah, that's what I thought. I'm trying to do it as a custom widget but not sure how to set it for 300s.

rugged rapids
formal dawn
#

hey guys! sorry if im asking it in the wrong channel, i'm really curious as i know there's a way to put the streamlabs API key into a streamelements widget, but I only need it for "tip" option, since I've been using that one on streamlabs for forever, I know the easy way would be to switch, but I'd rather keep it there and use the API key in the already made widget. So this is basically the widget I'm talking about https://streamelements.com/dashboard/overlays/share/5de9a01f0a74c326b5fa6c68 as I'm really new to these things and mainly know CSS (just by figuring things out myself), I need help in where, and how should customize the JSS part in it. Thanks whoever replies and I hope you have a good evening niciC

#

^ Btw, just for more information I tried importing my tips from streamlabs to streamelements but it doesn't work as good as it should, as in the latest tips aren't showing the actual latest one, etc. ^^

viral patrol
#

All aggregates should be refreshed after first stream you do after conversion/import. It can be short like 10 minutes, but stream start/end recalculates your data. Also first tip should automatically override "latest tip"

woven zinc
#

Hi, I'm interested in running a python websocket script with python-socketio to log some stuff. I can successfully connect and get authorized, log event:test, event and event:update from the main room/namespace.

Are there any more namespaces(there's a 'contests' room) or event names that I can subscribe to? Thanks

viral patrol
woven zinc
#

yeah, that the msg I'm mentioning

woven zinc
#

do you know if there're any other type of rooms or events?

viral patrol
#

Most of events are coming directly in main room.

#

AFAIK only contests are separately (but I may be wrong).

woven zinc
#

we don't get chat (i.e: cheers) right?

viral patrol
#

cheers, tips, subs, followers are dispatched within main room.

#

as event

woven zinc
#

nice, thanks lx

lucid umbra
#

Hello can someone help me out? :), I have no experience with coding. What I want is a static Text Source in my Streamelements Overlay that reads an api, with full control of the text setting (letterspacing, font etc.)

viral patrol
#

Is it external API or SE API?

lucid umbra
#

external, its from Songify

viral patrol
lucid umbra
viral patrol
#

If you have songify endpoint that returns what you want to display it should be easy to implement that (so just add a function that fetches new data every 5 seconds)

lucid umbra
#

Thank you for helping :) but I didn't understand anything you just said haha. I will look into this later

viral patrol
#

You can DM me with a source of text you want to get displayed in your widget and I will be able to add it to that widget.

summer zodiac
#

Hello, is there an option to integrate a command, which shows the current tip leaderboard in the twitch chat? I would love that feature

viral patrol
#

You will have to write MITM proxy that could do that (fetch data from SE and then post it as bot).

summer zodiac
#

Cant do that on my own i guess

soft sorrel
#

is there a way to export a custom widget, and import it in an overlay?

rugged rapids
#

You can copy widgets from one to another overlay via the copy button in the layers section in the editor.

soft sorrel
#

cool, thanks. didn't notice it worked cross overlay

calm quail
#

Hi, I'm interested in put my chat box in my streaming (similar that StreamLabs ChatBox) Anyone know, any api to develop this?

broken coyote
#

Your wanting to port you streamlabs chat over? @calm quail

nocturne gust
#

It there any documentation on the coded needed to post a message in the chat (like the standard commands like !uptime do) or another custom widget that does this? (that I can cheat off)

calm quail
#

@broken coyote No, i want to take a similar widget that u can see in streamlabs (chatbox)

broken coyote
#

You’ve got me all kinds of confused. Do you want a widget for stream elements or stream labs?

calm quail
#

I want use Streamelements, but streamelements dont have a widget similar that stream labs (its called chatbox)

upper bough
#

@calm quail You can do that add the chat widget on your overlay and add the overlay to your obs

calm quail
#

@upper bough Ye, but i want to edit style of chat like a "ChatBox"

upper bough
calm quail
upper bough
#

We don't have that feature

calm quail
#

Ye, then i think its inter. to develope

shrewd wadi
#

Hey guys how do I find the activity ID/s? (follows/cheers/hosts etc)

visual lava
#

I'm assisting a streamer with a sponsorship that is through Stream Elements. I'm trying to find historical logs/feeds of events that happened through the custom overlay. So The sponsorship has 2 goals, and I see two matching events in the settings for it. The numbers seem to increment correctly and it displays the name of the person who completed the required conditions, but then I can't find any way to view this data after the fact? It seems that Activity Feed/Widgets/goals would be the place to look, but I see only the normal follow/subs/donos stuff there, and no way to add additional goals.

viral patrol
#

The streamer should ask his/her Account Manager to enable this data.

nocturne gust
#

Sorry for the repost, but I'm still looking for any documentation on the code needed to post a message in the chat (like the standard commands like !uptime do) or another custom widget that does this? (that I can cheat off) Thanks.

heavy coyote
#

I’m trying to increment the value of a counter by the current number of channel views. How do I properly nest ${channel.views} inside of ${count <name> +<step>} ?

viral patrol
#

@nocturne gust Unfortunately it is not possible to trigger a bot command via overlay

#

@heavy coyote I would try: ${count viewers '+${channel.views}'}

heavy coyote
#

Thank you @viral patrol !

ocean fractal
#

is there a way to grab a sub-object off of the response that comes back from ${customapi.[url]} ?

#

like if the json that comes back is {"text":"thing i want"}, how do i grab text?

#

or is the process different from using customapi

#

I'm just using the chatbot and its variables btw

mystic rune
#

anyone know how to decrease a variabel by one on the overlays dashboard?

#

the sub count counts with me

hardy walrus
#

@mystic rune You can't to my understanding unfortunately.

mystic rune
#

:/

nocturne gust
#

@viral patrol I apologize for not being clear, is there a way to have a custom widget to post to the chat? When chat types !uptime streamelement will post a reply in the chat, is there a way to post to the chat from a custom widget? If not, then I can think of something else, thanks for answering my clarification.

cerulean bison
#

So i currently have this, i'm looking to have the Gifter and Giftee

#

but i dont know the variables

ocean fractal
cerulean bison
#

You're right i'm just unfamiliar 🙂

#

I guess i'm unsure how to use this in the event of how i have things setup xD

viral patrol
#

@nocturne gust This would require proxy service to forward information between widget and authenticated SE API (as you don't want to have SE API authentication embed in widget)

trail sequoia
#

hi you load of clever people...been a while since I have been here so....I am making a custom widget for the other half and I need to get query the endpoint to the top loyalty points in her channel. however the return I get from the get request is.

#

{"_total":0,"users":[]}

#

however there is def a list there. Can somone help my tiny brain please and tell me the correct.

#

here is the code so that is pretty much direct from the docs

#
import requests

url = "https://api.streamelements.com/kappa/v2/points/channel/top"

headers = {
    'accept': "application/json",
    'content-type': "Content-Type",
    'Authorization': 'Bearer {TOKEN}'
    }

response = requests.request("GET", url, headers=headers)

print(response.text)```
viral patrol
#

you should have guid instead of channel in your URL. Authorization is not required there AFAIK

trail sequoia
#

oh shit just realized I didnt put her channel

#

lol gimme second

#

same output hold on this is what i put

#
import requests

url = "https://api.streamelements.com/kappa/v2/points/missrudders/top"

headers = {
    'accept': "application/json",
    'content-type': "Content-Type",
    }

response = requests.request("GET", url, headers=headers)

print(response.text)```
viral patrol
#

You should use guid. For this channel it is 5eab1a7fc644de5b0169703c

trail sequoia
#

also remove the comma hold on sigghhh

#

okay mate thanks gimme sec

#

ohhh her acc id

#

legend as always lx...perfect

#

thanks sir

viral patrol
#

You're welcome!

trail sequoia
#

off to make it look pretty later 😄

rugged rapids
#

lx is just a GOD! SEheart

trail sequoia
#

ikr, your not far off though 😄 peace!!!

hardy walrus
#

@trail sequoia Here's one thing to making the code look pretty in discord: Use 3 backticks at the beginning and end of the bit. That way it'll look nice and pretty like this:


url = "https://api.streamelements.com/kappa/v2/points/missrudders/top"

headers = {
    'accept': "application/json",
    'content-type': "Content-Type",
    }

response = requests.request("GET", url, headers=headers)

print(response.text)```
trail sequoia
#

ooooooooo peerrrrtttyyyy....hold on

viral patrol
trail sequoia
#

ooooooooo

hardy walrus
#

Simply specify the language after the first 3 ticks.

trail sequoia
#

well knock me over with a feather that is pertty...later all thanks again

trail sequoia
#

phew

nocturne gust
#

Thanks for the clarification @viral patrol 🙂

gritty aurora
#

Hey, since I have no way of testing right now, does the subscriber-goal value go down if you lose a subscriber, or does it just simply count the amount of subscriber events?

#

same with follower-goal

real dune
#

doesnt go down as SE doesnt track unfollows/unsubs

viral patrol
#

If you want to track those numbers, you should use other endpoint like subscriber-total or follower-total

glass nimbus
#

Hello I want to add the truckers fm to the currently playing scrolling text but it’s not an option so how would I do this. Please help, Thanks Aaron.

viral patrol
#

I think that the best option is to use their dedicated extension

#

It doesn't have stream widget, but your viewer will see current song under the stream

glass nimbus
#

Oh ok

hollow bison
#

Hello, is it possible that when a person takes out or renews his subscription, the "!slots" command is automatically triggered?

thank you

velvet cave
#

it states everyone rn

#

this means only subscribers can use it

#

oh excuse me im actually reading that wrong

#

You could set a keyword alias that is in your chat alert suscribe message maybe

#

not sure if that'll work

hot wharf
#

Hi code guru's! Is there a way to track if the battle boss has died? I want to set macro's on automatic that will switch my scene and sound an alarm 🙂

tranquil mist
#

Is the Hype Cup source available anywhere? I'm trying to understand how it gets a list of all the cheer emotes within a given message

elder dragon
#

How would i see if a user's twitch message is his first message ever on this channel?

elder dragon
#

Alright thank you!

viral patrol
#

Hmmm. I don't see that documented anywhere

#

@tranquil mist You can parse chat messages and you should have them in "emotes" array

random valley
#

Hello!
Any help would be appreciated!

I am setting up a widget, which displays, among other info, the "latest tip". However, it is gathering that info from my Mixer account, and I have since moved to Twitch. I am wondering how I can change it so that it will take the information from my Twitch donations mage instead. Thanks!

real dune
#

looking for the following for a streamer:

kappagen gifted subs causes 4 explosions to go off,
want to reduce to 1

halcyon surge
#

hi

#

The CSS on their website is also broken for me, but thats beside the point. I never did anything with SE so as a newbie with their API I dont know what the channel id is. is it the channel name or some id that the channel owner can see in their dashboard. Also would like to use a websocket to connect but I didnt find any information how to start it via websocket as well. Also in the response I kinda can get how the parameters could look like and start tinkering with their api to see what goes but this is jsut not cool. No idea what the options object looks like as well. Its really frustrating to study such docs

#

If someone has ever done this or know how to start a contest. Would it be something like this (taking on their NodeJS example):


var options = {
  method: 'POST',
  url: 'https://api.streamelements.com/kappa/v2/contests/<channel-name>',
  headers: {accept: 'application/json', 'content-type': 'text/plain'},
  qs: {
    minBet: 5,
    maxBet: 10,
    duration: 600, // seconds or milliseconds?
    title: 'Example Titel'
    options: {} // no idea how this object should be structured
  }
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});``` Am I on the right way?
twin condor
#

I'm looking for a way in the chat bot for a queue system. Is this possible?

sinful scarab
#

Hi, I was wondering if there is a way to make a !clip command and if this has already been done

viral patrol
#

Two latest request, one amazing API 😉

#

@halcyon surge It is not channel-name but channel ID. Payload for that is:

{
   "title":"Will I win the next game?",
   "minBet":10,
   "maxBet":10000,
   "duration":5,
   "botResponses":true,
   "options":[
      {
         "title":"Win",
         "command":"win"
      },
      {
         "title":"Lose",
         "command":"lose"
      }
   ]
}

In response you will get object with details about created contest, you now need to start it via sending PUT request with empty JSON object ({}) as body to https://api.streamelements.com/kappa/v2/contests/:channelId/:contestId/start where :contestId is _id from previous response

halcyon surge
#

Wow thank you so much @viral patrol

halcyon surge
#

About the auth2 token @viral patrol do they just have this one JWT static token or do I need to validate and refresh the tokens to be able to query their endpoints?

viral patrol
#

About Oauth2 token - you have Authorization token and refresh token provided. If your access token is expired, then you should query refresh token endpoint to get new auth one.

halcyon surge
#

I get the idea of oauth2 but then again they state there is an auth token in the dashboard which confuses me:

halcyon surge
#

ok using the JWT token from the profile I somehow managed to eff it up @viral patrol

#

it didnt accept my params for minBet, maxBet and so on. Trying to stop or end it now via a PUT to /start or /end also doesnt work

viral patrol
#

There is an endpoint /close to end contest

zenith fossil
#

Is it somehow possible to make a "Last.fm" Command to show which song is playing?

viral patrol
#

Then you should pick a winner via calling PUT https://api.streamelements.com/kappa/v2/contests/:channelId/:contestId/winner with payload {"winnerId":"optionId"}. Option ID you can get from response to contest create call

#

@halcyon surge ⤴️

#

@zenith fossil I am not aware of any REST API service that could provide this information as plain text. If you have any you can use bot response containing ${customapi.URL}

zenith fossil
#

I just found something like that, but I don't understand anything. :D

viral patrol
#

This won't work on SE as SE bot doesn't parse JSON output. It has to be raw text.

zenith fossil
#

Ah, alright. Thank you! :)

viral patrol
#

@halcyon surge Another thing about JWT - it is OK to create a tool on your local PC that uses that (personal use only), creating a tool for others would be way better (when it comes to safety and user experience) by requesting OAuth credentials for your tool, so user can get their authorization tokens.

halcyon surge
#

oh yeah its personal use only anyways so its fine. So my problem is still about creating the contest and giving it the parameters. I do this atm and it creates a contest with no options, disregarding everything and just going with the default values:

#

I guess I am doing it wrong by putting it into the qurey parameter strings?

viral patrol
#

Content type should be application/json

halcyon surge
#

Ill try that out I thought this would only apply to body and not to the query strings

#

alright I changed content type to application/json and changed it from qs to body now it works @viral patrol thanks for your help

#

One more thing: do you know how to set a winner?

#

The docs are so bad at giving informations 😦

viral patrol
#

Payload in that case is also JSON body

halcyon surge
#

oh man sorry

#

thanks for your time

#

Now everything works. Thank you for being a docs replacement for me 😄

#

Hope they get someone to work the docs out in the future

tranquil mist
glad urchin
#

I'm working on a custom widget, but I'm not seeing any of my console.log messages. I am viewing in a browser with ?debug=1

#

any ideas?

glad urchin
#

nevermind, it was an ID10T issue...

broken coyote
#

HA the ol ID 10 T error

snow summit
#

Can there be multiple counters used in an overlay?

glad urchin
#

In the message object is there a good way to detect if the message is a command?

#

beyond parsing it manually

#

I see isAction, but that never seems to be anything beyond false

glad urchin
#

I see badges array, that might be the easiest to use

mild cipher
#

You could check if the first character of the message is an exclamation mark

#

(isAction will be true for /me messages)

north cedar
#

Hello everyone I am here to find some help in making a widget that shows teams for pokemon? I couldn't find anything so I'm going to try my first custom widget any help would be great thankx

glad urchin
#

Thanks theFyrewire 🙂 Yes I’m going to write my own parser to get the commands with the ! check. I was just curious if there was an easier way like a flag set by the system.

pulsar willow
#

Hi all I was wondering if someone could tell me how to send a message from a custom widget to chat...it doesn't need to be a fully fledged bot just one reset command for the leaderboard...Sorry for my ignorance of ajax

#

var data = {"message": "test"};
var token = "secret"

var xhr = new XMLHttpRequest();

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.streamelements.com/kappa/v2/bot/5eab1a7fc644de5b0169703c/say");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("Authorization", `Bearer ${token}`);


xhr.send(data);```
hardy walrus
#

@pulsar willow 200 I belive is just acknowledging.

#

That would probably be a good idea LULW

pulsar willow
#

got it working

hoary kindle
#

I have no idea whether this is the right place for this, but is there a way to import a font that I have installed on my laptop into stream elements. I'm trying to use a certain font for an alert.

high swallowBOT
#

@hoary kindle Google Fonts
More than 900 google fonts are supported at this time. You can preview them here: https://fonts.google.com/

Custom Fonts

Steps:

  1. Install the font on the streaming PC or choose a pre-installed windows font.
  2. In the overlay widget settings, select Text Settings
  3. Enable Custom Font
  4. Type the name of the font as it appears in the windows font directory (This is usually C:\Windows\Fonts)

Note: After installing fonts, the browser and OBS must be restarted for the font to appear.

glad urchin
#

If anyone else is looking for a way to make chat commands change scenes or toggle sources, I just got done making a custom widget to do that with the OBS Websocket plugin. https://github.com/thefunvampire/StreamElementsRemoteParameterWidget

#

Gonna goto bed now 😂

simple wraith
#

@glad urchin before you sleep; does it spit back the whole JSON in chat

native trellis
viral patrol
#

It doesn't output anything into the chat from what I see

vast crown
#

I have a problem with streamelements chat stats

#

is there any staff?

hardy walrus
#

@vast crown 2 things.

#

Wrong channel.
Have you changed your name recently? If so what's your current/previous name.

vast crown
#

I changed name

#

5 or 7 months ago

#

But I dont know what to do

#

and sorry for the wrong channel, im here 1st time

hardy walrus
#

Is raiichi_ old or new one?

vast crown
#

raiich_ is new one

#

raiichcz was the old one

hardy walrus
#

@vast crown It's fixed. For future reference please ask anything related to our services in the appropriate helpdesk.

vast crown
#

Thank you so much

pulsar willow
#

Hi what is the api asking for when it says type?

#

channels?type=type what does this meannnn lol

#

just want a list of current viewers

#

should I put channel=missrudders....thanks

mild cipher
#

the users/channels endpoint is not for getting viewers in a channel, it's for listing which SE accounts the channel has access to (bot supervisors/editors, etc)

pulsar willow
#

nevermind got it

#

yeah

#

fyre where would I need to query to get the current viewers?

#

is this possible

mild cipher
#

there is an undocumented endpoint somewhere through twitch, but I can't remember the path. you can probably dig it out if you google it, but otherwise it's not possible with SE atm

pulsar willow
#

okay mate thanks I will google...not a fan of twitches docs...thanks anyway

#

wow that was painless lmao

#

thanks

tribal tapir
#

What is the variable to fetch current song/youtube video from the media request? I can't find it under variables

hardy walrus
glad urchin
#

@simple wraith it does not spit anything back into chat - only the original message is saved in chat. Like “!gotoGamingScene”. I put my responses in the streamelement bot custom commands list, this way the commands show up on a list for users and mods

simple wraith
#

^ @upper bough anismart

#

there's 3 variants of that now, @glad urchin - yours spits it out "clean" , but it's still a messy setup imo

glad urchin
#

This is just the initial release, Im already thinking of a way to make the command setup easier and without streamers messing with JSON

#

I wish FIELDS had a build in list element

#

Unless someone points one out, I’m going to make one basically.

ivory marsh
#

Is there a way to setup sub commands, so I could have something like !wins, !wins add 10, !wins reset for example

glad urchin
#

Sounds like you want to use the count variables @ivory marsh

#

Then setup a command to view wins (like !wins) then another for increasing wins (like !AddWins 10) - something like that?

ivory marsh
#

Ideally I'd want it setup like above where it can just be the one command !wins with different actions, I have something setup along the lines of multiple commands like that !wins, !addwins, !resetwins, ect, just curious if there was a way to make it more unified

viral patrol
#

@ivory marsh Addwin ${count wins '+${1}'} resetwins ${count wins 0 }

ivory marsh
#

in the same way there is !cmd add, !cmd edit, !cmd del

viral patrol
#

Unfortunately command doesn't get variables.

ivory marsh
#

I know command doesn't have vars, but see how it's not !addcmd, !delcmd, !editcmd or the like? it's all !cmd <action>, is there a way to set that up with custom cmds

broken coyote
#

@simple wraith are you saying his code is messy?

simple wraith
#

the way to program it through JSON

#

in comparison, Renzito's method is ![command] sceneName | sourceName

#

or, if you want a timer

#

![command] sourceName [argument]

#

Granted, this does show in chat

#

while Vampire's doesnt.

#

@broken coyote 🙂

broken coyote
#

I’ll need to remember to stop posted code. Don’t want you go thru the @simple wraith ringer

native trellis
simple wraith
#

im not saying it bad, just.. not friendly for users who'd need to set it up who have no clue how it works pepo_shrug

#

people can barely understand how to setup basic commands NotLikeThis

#

But sure.

broken coyote
#

Cat is out here trying to share code and your calling it messy. If you think it is. Just move on. No need to sham someone out here trying to share stuff. I code is not clean, but it works. Users shouldn’t even need to look at the code. But I’ll deff remember to not post any code.

simple wraith
#

fwiw, it's not the code, but the whole command. But let's put this aside, shall we @broken coyote? Even Fun himself agreed on it to find an easier method; no harm done 🙂

broken coyote
#

That awesome he is fine with it. Rub’d me raw

glad urchin
#

Oh yes I agree with @simple wraith - not a fan of the JSON, it requires too much knowledge on the user side. Which is why the instruction read me is kinda long. My goal is to make fields in the widget side that let you enter the commands you want, check a box for mods and or everyone to use, click save command and be done with it. Trying to figure out how i want to list and provide the ability to end saved commands

#

To edit* saved commands

simple wraith
#

I think you and @upper bough should have a moment to sit and compare/talk ideas @glad urchin! If you could combine your features that don't spit out the command in chat, with his ease of setup, we have a banger SEheart

glad urchin
#

From the sounds of it @upper bough just inputs the commands directly into chat? Or his command inputs them into chat? Mine parses the message and finds a command linked to the parsed message.

#

Gotta love coding, always a million different ways to build something 🙂

upper bough
#

this is 100% true

glad urchin
#

Does anyone know if it's possible to dynamically update the FIELDS object?

mild cipher
#

Not possible as far as I'm aware

broken coyote
#

I created something close to @upper bough but mine switches scenes on alerts and then goes back to the original scene

glad urchin
#

Very nice 👍

narrow spade
#

Is there a way to create a custom command that fires off custom code so I can do more complex things.... or even simple queries to my own database... etc

glad urchin
#

Hey @narrow spade - yeah if you take a look at the code i posted above, mrboosts or renziito’s you’ll see events get fired in JS when a message is sent in chat; inside this even you can execute all sorts of JS code.

#

Inside this event*

narrow spade
#

@glad urchin Thank you

elfin arch
#

i just kinda of skimmed the project you are working on @glad urchin so i could be mistaken; but there is a 'dirty way to build the JSON you want from the field inputs.

woven field
#

Hello there, is it normal that the "checkbox" field type is not updating/reloading the whole widget ?

glad urchin
#

Hey @elfin arch - good idea but i actually found a way already. I’m almost done, but its late and I don’t need to pull another all nighter lol. So the method i’m adding is to use a group to enter command data, that group has a “create new command”. This adds the command to my array of commands. I then save the array to the SE_API.Store. I use another group and dynamically populate a dropdown field with all of the commands in my array. This will allow the user to select a command and remove it (eventually i’ll give them edit capabilities).

#

Yall have a wonderful night/day!

snow summit
#

In the Widget Editor, is there a way to designate bold, italic, underlined options? Similar to the bold B, Italic I, and Underline U? Or do I have to three seperate "Yes"/"No" questions?

#

Hello there, is it normal that the "checkbox" field type is not updating/reloading the whole widget ?
@woven field Not normal.

atomic coyote
#

I feel like I'm missing something obvious, but where can I test the widgets I create while developing them ?

viral patrol
#

You mean when you are developing them in your IDE?

atomic coyote
#

Yes I use Visual studio, and thanks for the help 😄

vapid magnet
atomic coyote
#

By option to add text do you mean that you want the user to be able to add custom text in the widget ?

vapid magnet
#

The label only shows a number now i would like to add a custom text before that number within the widget.

glacial drum
#

hi i wanted to add browser sources to overlay editor , can someone help me out?

hardy walrus
#

@glacial drum Not possible.

glacial drum
#

wait for real? i got the snowfall thingy and the spotify broswer source etc , its still impossible? like merging 2 or more overlays ?

hardy walrus
#

If you mean copy a widget from one overlay to another yes. But actual browser sources in it no.

glacial drum
#

ohh

atomic coyote
#

@vapid magnet First you need to add the "customLabel" field in the json file (the Fields tab)

#

Then inside the html you can call {customLabel} where you want the label to be placed like so :

#

The name inside the html must match the name you gave in the fields section

#

I hope this was what you wanted and that it helped!

swift birch
#

I have a bulk gift animation that is putting the rest of the queue on hold. Any idea how to let the other widgets fire off at the same time?

elfin arch
#

if i want to submit to the #widget-share, do I have to use JSfiddle and pastebin? Can i send a link to the overlay or github files?

glad urchin
#

I thought I would use jquery to update some fields in the editor properties, however that seems to be bound to an angularJS viewmodel. I've never used AngularJS, is there any way to update this VM or the data in these fields through the customizable JS code?

vapid magnet
#

@atomic coyote that is exactly what i wanted, thank you!