#dev-chat

1 messages · Page 34 of 1

mild cipher
#

The animation can only run if it's visible, so toggling visibility off or being in a scene that doesn't have the train won't reset the animation

#

If you need to hide it moving it off out of the scene works, as long as the source itself isn't hidden

rich pine
#

Ah ok, I’ll give that a go!

silver anvil
#

is there a way to trigger the kappagen emote explosion for a web service call?

rich pine
#

@mild cipher got it working, appreciate the help. figured it was doing something wrong but wasn't sure

visual ginkgo
#

Hi guys! Did u ever heard of app called Greetings for SLOBS? Any chance to find same thing for SE?

upper bough
#

what "grettings" does?

visual ginkgo
#

@upper bough special gif and music for subs, vips, viewers, mods or for custom username

#

and u can set your own gif/music, so i put music and gif for my regulars

#

for example every time when user1 says hi, it plays his song and his gif

upper bough
#

maybe it is what you looking for

visual ginkgo
#

@upper bough oh, yes it is! ty so much! i guess it's pretty new one, cos it used to be no widget like this before for se!

upper bough
crisp holly
#

Hello! Having an issue trying to get a JSON object from exterior site. Here's the code I'm trying to use:

window.addEventListener('onWidgetLoad', function (obj) {
  alert('test');
  fetch('https://[url]?locationId=108', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)
  }).then((response) => {
    return response.json();
  })
    .then((myJson) => {
    $('.main-container').append(myJson);
  });
});

I don't seem to be getting anything back at all.

upper bough
#

h ttps://[url]?locationId=108 is working properly?

crisp holly
#

Copy/pasting into my browser works as expected

upper bough
#

fetch(https://[url]?locationId=108, {})
.then(response => response.json())
.then(myJson => $('.main-container').append(myJson));
});

crisp holly
#

Tried this. Still no visible return. Updated code:

fetch('https://[url]?locationId=108', {})
    .then(response => response.json())
    .then(myJson => $('.main-container').append(myJson));
});
upper bough
#

long shoot but maybe .main-container miss spelling on html (?)

crisp holly
#

This code appends nothing to html:

window.addEventListener('onWidgetLoad', function (obj) {
    fetch('https://[url]?locationId=108', {})
      .then(response => response.json())
      .then(myJson => $('.main-container').append(myJson));
    });

    $('.main-container').append('test')
});

This code prints 'test' to html:

window.addEventListener('onWidgetLoad', function (obj) {
    $('.main-container').append('test')
});
mild cipher
#

If your only goal is to inspect the response, log to console instead. Easier to read smile1

window.addEventListener('onWidgetLoad', async function (obj) {
  const data = await fetch('http://ip.jsontest.com').then(d => d.json());
  console.log(data);
});
#

(You can also check the network tab)

indigo flume
uneven oxideBOT
#

@upper bough, you have been awarded a commendation :star: by @tacit musk for answering a question in #dev-chat. Keep it up! SEheart

crisp holly
#

Network tab?

#

Oh, nvm

crisp holly
#

Do I have access to a clock of some sort? Maybe a listener or a timer?

#

Thanks for the help, btw. I was able to move forward

upper bough
#

You can do a javascript ticker ?

crisp holly
#

I'll try that. Thanks

keen blaze
#

@mild cipher by chance do you have an eta for your website to return? queue system is offline and looks like thefyrewire.com no longer loads (assuming it's related)

lusty portal
#

Does anyone know what the obj.detail.listener is for a merchandise call is?

broken coyote
#

merch

lusty portal
#

I tried that. Didn't work.

#

That and "purchase"

broken coyote
#

let me take a gander here

#

obj.detail.event.event

lusty portal
#
window.addEventListener('onEventReceived', function (obj) 
    {
        if (!obj.detail.event) {return;}

        if (typeof obj.detail.event.itemId !== "undefined") 
            {obj.detail.listener = "redemption-latest"}

        const listener = obj.detail.listener.split("-")[0];
        const event = obj.detail.event;
  
        if (listener === 'follower') {addFollowEvent(event.name);};
        if (listener === 'redemption') {addRedemptionEvent(event.name);};
#

That works..

#

if (listener === 'merch') {addMerchEvent(event.name);};

#

Doesn't

#

Are you saying "merch" should be "event"?

broken coyote
#

if (event.event.type === 'merch') {addFollowEvent(event.name);};

#

i didnt change the end part. just the listener

lusty portal
#

Oh.. So merch is running differently than follow alerts at the moment?

broken coyote
#

yea

lusty portal
#

Would that work the same if I removed "listener" all together and just used that?

#

if (event.event.type === 'follower') {addFollowEvent(event.name);};

broken coyote
#

just event.type

lusty portal
#

Gotcha. Thank you. 🙂

broken coyote
#

yaya no problem cap'n

shadow urchin
#

Is there a list of CSS variables for SE? I have custom code from SL that I'd like to move over, but I'd need to know how best to do so. The importer doesn't work

upper bough
#

i just read that existe a channel-points-channel-v1.<channel_id>, to see A custom reward is redeemed in a channel. but need channel:read:redemptions scope

indigo flume
#

@shadow urchin check channel description

lilac rapids
#

Hey everyone I am currently trying to dynamically check the sub train counter in another widget to trigger an animation if its greater than 10 and I am currently unable to get any data from the sub train widget. I have tried queryselector/queryselectorall and also jquery class searches. Is there something super simple I am missing or is this even possible?

indigo flume
#

Which sub train are you referring to?

#

our default one?

lilac rapids
#

yea

indigo flume
#

I don't think the default train widget has any open API or custom widget open points

#

Why not more or less make your own internal counter for it and simulate it and count the subs?

lilac rapids
#

that was my next step.

knotty thorn
#

it seems whenever i grab the session info from the api, the sub points don't add up correctly - eg right now I have 12 sub points, but you guys are showing 8

velvet cave
#

That is a known issue at the moment

knotty thorn
#

sweet

indigo flume
#

Its due to a change from Twitch API

#

and we are working on readjusting to thee change

knotty thorn
#

ok cool

jaunty breach
#

Hi,

Is there a custom way to hype the gifted subs?
Right now it's thanking by just hyping each person who got a gift so when someone donate 10+ it's just a full line of spam from the bot. (an example: https://imgur.com/dWGL3Ce)
I was more thinking of something like this :
"{user} just gifted {amount} of subs! Thank you"

Asked the help center who redirected me there. Thank you

viral patrol
#

Hi there! I think that there is no way to disable bot announcement for gifted subs.

pastel crystal
#

Hi, hoping im in the right place. I am trying to set up a custom widget using twitches channel points redemption as per their pubsub documentation (as it seems streamelements have not yet implemented this into its own api). I have the websocket working in a demo page, but when i copy/paste it into my widget (with minor modifications to trigger an alert instead) it doesnt seem to work. Is something about streamelements stopping me from having a separate websocket in a widget? and where can I find the code in chromes developer tools so i can debug for myself?

velvet cave
#

@pastel crystal this is the right place, only, the twitch channel points API is still closed if I'm correct

pastel crystal
#

To get custom redemptions works, as i said the web socket worked on a standalone test page. The hardest part i had was figuring out what my stream ID was.

pastel crystal
#

a screenshot of the working demo. All i changed in the code that i put into SE widget was the action when recieving the message. However i dont see the messages coming in in the network tab.

indigo flume
#

channel ID is a public entity, but the JWT and overlay token are the things you need to hide

#

just saying

#

unless thats the twitch channel id ASpikaThonk

pastel crystal
#

those two arent showing here cos this isnt in StreamElements, my issue is porting it into streamelements. Thats the twitch id, which is public, but it took me forever to find it (i eventually found it by opening the channel as a guest, getting an ad watching a video, and checking the "last_preroll_ad" session entry which contained the stream_id of the stream the add was seen on)

#

but its the only remotely personal data there, other than my name, which is much easier to find. So just being overly cautious

crisp holly
#

Hello! Could I be directed to documentation for widgets interacting with chat?

indigo flume
#

Channel description @crisp holly

crisp holly
#

Yea, I have been trying that. But I'm finding it difficult to locate the info I want

#

And so why I'm here

indigo flume
#

@pastel crystal I believe you need to see upon a message received in our chat if the points redemptions are triggered, else you will have to make the overlay widget connect to the twitch pubsub

#

@crisp holly there is an event for a message

crisp holly
#

Awesome ty

#

Wait. What doc is that?

indigo flume
#

the github one

#

click o nthe channel description

crisp holly
#

That's the one I thought I looked at

#

ok thanks, @indigo flume

pastel crystal
#

Thanks keizar, I'm trying to connect to the twitch pub sub, and it's working on a separate webpage, but not when I copy the code into a custom widget.

crisp holly
#
window.addEventListener('onEventReceived', function (obj) {
    const listener = obj.detail.listener;
    const data = obj["detail"]["event"];
  
    if (listener === 'bot:counter' && data.counter === trades)
      updatePanel ();
      else if (listener === 'message') {
      $("#total").html ('test');
      $("#total").html (data["text"]);
    }
});

Testing the message event and not getting any value for data["text"]. 'test' works as expected. Could anyone help me figure out what I'm doing wrong?

#

Console shows the object properly as well

#

nvm. data.data.text seems to work fine

carmine atlas
broken coyote
#

there is. let me find it

#

well. maybe

shell tree
#

the lawyer has completed his search yogevThink

broken coyote
#

hahaha

carmine atlas
#

@broken coyote ty

broken coyote
#

no problem

crisp holly
#

Tried the method suggested in doc to send a message to chat. Did not seem to even build properly. Did not find anything regarding sending messages in the github doc

#

I'm probably doing something wrong again

viral patrol
#

I took the code you pasted before and it worked for me without any problems.

crisp holly
#

I can read chat just fine. It's sending a message that bewilders me

chilly peak
#

where can i add the donate goal?

velvet cave
#

Hey Krexy over at the overlay editor via the website

viral patrol
#

Oh. Unfortunately you can't send messages directly (or you shouldn't as it could expose your JWT token)

#

The best way is to create MITM script that will handle just chat and will store your JWT in safe place

terse anchor
#

Is there a way for me to create a list of user names that want to join lets say a heist mode I created? Someone types in !heist, other people want to !join and then i can roll a 1 or 2 too see if they won or lose?

#

is that possible for me to create using the current api?

pastel crystal
#

Hey guys, I am still working on my twitch points redemption widget... and progress has been made. However, as I am connecting to twitch directly, i need an Oauth token, is there one that streamelements already has that I can use? or any ideas on how i can get it within the widget?

pastel crystal
#

I have 100% got it working on a localhost webpage, which i have put into obs as a browser source. but cannot figure out how to get it running through Streamelements due to the authorization issue.

shut charm
#

Hey everyone, what's the timeline I could expect to hear back from the OAuth application process? I submitted through the form on Friday of last week and I know we obviously just had a long weekend so not rushing, just curious if there's any expectations of how long it takes to review before you would hear back. Thanks!

viral patrol
#

@shut charm OAuth access due to early stage is granted in batches, I am sure your request is in queue and will be added pretty soon.

shut charm
#

@viral patrol Cool thanks. Just wanted to get an idea of if it's something that'll be done relatively soon or if it's more a month+ sort of thing. Thanks for the response!

worn anvil
#

Hello! I thought I had seen other Twitch channels with custom emotes as an SE loyalty point item. Is that possible?

indigo flume
#

Can you elaborate what you mean?

worn anvil
#

I have emotes made that I would like viewers to be able to buy using SE points- is that possible? @indigo flume

indigo flume
#

Not with our loyalty points, no

worn anvil
#

Thank you anyway:)

deep arch
#

Hi I am using awesome shoutout and made a custom@command That brings up the command for the shout out and nothing was happening yesterday but it’s worked before

velvet cave
#

@steady iron Rene! @deep arch is having some problems with awesome shoutout

steady iron
#

Hi there

deep arch
#

Ty @velvet cave

steady iron
#

step into my office, please

velvet cave
#

no worries haha

steady iron
#

left you a PM @deep arch

knotty thorn
#

does the merch part have an endpoint on the api?

broken coyote
#

Event.event.merch

shell tree
#

You can trust him. hes a lawyer.

broken coyote
#

Lol

#

if (event.event.type === 'merch') {addFollowEvent(event.name);};

knotty thorn
#

lol thanks

broken coyote
#

Disregard the addfollower stuff. That was something from some dudes widget

vital bough
#

anyone here?

#

how can i get the url of an asset i uploaded to library

#

i uploaded it nd a widget im using needs me to define it in the javascript but i cnt find how to get the url

hardy walrus
#

@vital bough Got a second to hop in chitchat?

nova hedge
#

Does anyone have a list of commands for each site connected to SE and what type and value they produce. Basically mocks for everything since the Alert box doesn't actually trigger the socket API

real dune
#

code nerds, i have a panel i want to slide in from the right whenever the source first activates, how do i do plz? can give cookie...

i want to toggle this on and off in obs,
need a delay to the animation of about 3 seconds, then have it slide in from the right

seagH

crude crest
#

Personally, I just use the obs motion-effects plugin to move things about the screen (like slide ins and the like). Then you can just have it hot-keyed and slip and slide anytime you want.

pulsar willow
#

How do I get overlays without pc

crude crest
#

Check out things like "Go Lightstream"

trim gate
#

@simple wraith i'm using your step goal widget for sparks and it doesnt function with the colors and such like it does with follower, sub, tip and bot counter types. is there a way you could update it and have it function with sparks like those do or is that just part of it in the works to make it work like those do?

fallen horizon
#

not sure if i ever got a reply to this, but i currently use strealabs chatbot for its remote parameters script. does SE have something similar where a keyword in chat can change scenes, hide/show sources and play audio files

velvet cave
#

^ that is a good question, I'll ask around for you @fallen horizon

simple wraith
#

@trim gate i haven't added sparks functionality, that's been added (graciously) by @mild cipher ; however i don't expect that it should be broken because of this, i'll take a peek.

trim gate
#

thank you because sparks doesnt act like the ones i listed do when i cycle through the options.

proven ember
#

I some help..... How do I setup a point/coin system for my loyalty store. I do not see where to set it up at?

hardy walrus
#

@proven ember YouTube?

proven ember
#

@hardy walrus Mixer

hardy walrus
#

Unfortunately it's a missing feature atm.

proven ember
#

@hardy walrus oof that sucks

#

So this only works on youtube?

hardy walrus
#

No. I was only asking that as it's another one lacking it.

#

But wasn't aware of mixer either.

proven ember
#

🔥

#

@hardy walrus One more thing. Is there a way for me to add a live video to my overlay? like another stream?

velvet cave
#

@proven ember I think there is some ways to do that, by just adding a browser source

#

however, do ask permission of the streamer firstly

velvet cave
#

I got a fun idea for a widget CodeGuru's

#

what about a widget that shows a animation/video of the amount of giveaway tickets that has been bought

#

so if someone buys, lets say, 5 tickets for a giveaway, you'll see 5 tickets falling on your stream 🤔

strong hollow
#

Morning everyone 🙂 . I need to get a widget/overlay with an image that slides on the screen and slides back off every 10 minutes. Is there one in the templates or anything anywhere that i can use?

indigo flume
#

Asset rotator widget - the animation settings for the widget work with it as well

strong hollow
#

Thank you 🙂

split arch
#

Hi guys, can I start and end bets/contests via API? Doc about is missing some infos :/

viral patrol
split arch
#

oh, thanks!

#

is there a text command to start/end contests without having to access the panel? for mods or channel editors to do that.

#

or I need to develop a own bot to do this?

leaden comet
#

BordeauxPrime sent me over here regarding a question I had;
Is it possible to have the auto-tweet message send what game we're playing? 🤔 Like by including {game}?

fading veldt
#

Hey, haven't really dabbled much with the API yet, and SE's Activity Feed isn't sufficient... what's the best way to see "raw" data for followers etc, including timestamps?
Use case example would be to capture lists of spam bots that followed at the same time. timmacTHINK

pulsar willow
#

Hey @broken coyote Your Chat widget does not remove messages when its been deleted in Chat

#

Can you maybe do something about it?

#

I was told to ping here

broken coyote
#

Easy fix. Don’t delete messages

#

I’ll take a gander at it

pulsar willow
#

Alright. Thank you sorry for the ping

broken coyote
#

I don’t mind

fallen horizon
#

@velvet cave any luck?

native trellis
#

and if you have any spare, can you pass it along?

remote juniper
#

Are there any plans on expanding the API for media requests? I would love to have a previous and next function 🙂

velvet cave
#

@fallen horizon sorry haven't gotten an answer yet, will poke em again!

drowsy rivet
#

anyone have experience with voicemeeter streamdeck integrations? I know it is somewhat off topic

broken coyote
upper bough
#

ok.. i just submit my first widget 😛

finite heath
sand igloo
#

Is it possible to group Fields together for a custom widget?

pulsar willow
#

Hello!
Can someone tell me if there is a way to read the width and height from a widget to utilise it in the CSS file?
I want to use the pixel size of the width of a widget for the size of a background image of an element in this widget.

viral patrol
#

@sand igloo just add "group":"Group name" to field properties

#

@pulsar willow This one should give you width of widget:

let width=$("body").width();
pulsar willow
#

Thank you @viral patrol
Can you tell me how to bring this value to the CSS file?
With the values from the fields I can use them in double brackets like {{widgetwidth}}

viral patrol
#

Oh... to the CSS, not really. You might want to dynamically change CSS definition in JS like:

let width=$("body").width();
$(".yourClass").css('width',width*0.5);
sand igloo
#

You sir, are awesome! That worked perfectly, Thanks!

pulsar willow
#

Thank you!
I'll try that 👍

fallen horizon
#

might be the wrong place to ask. Does anyone know the CSS to fetch and hide/show something from the SE libary

broken coyote
#

from the SE libary?

pulsar willow
#

@viral patrol That worked. Thanks a lot 😄

fallen horizon
#

fetch an object from this library and then hide it if another is fetched

broken coyote
#

the hide layer button?

#

are you referring to putting this inside of a widget?

fallen horizon
#

basically im trying to work out shrouds colour thing. he has the alert play and then at the bottom of his camera, he has a graphic that changes colour depending on what the alert was

broken coyote
#

oh bubby.

#

thats not how it works lol

fallen horizon
#

yes. the bit at the bottom of his camera as sam showed.

#

that changes colour. the bit going round is easy enough. i can do that

broken coyote
#

did you watch the whole video? i mean, he shows how to do the whole thing

fallen horizon
#

i did watch the whole video. he explained there is custom code for that bit i circled.

#

sams video shows how to do the smoke and stuff but for the colour changing logo after each alert it must be a fetch and hide code....right?

broken coyote
#

looks to me its the same animation, just changed colors and layered on top of each other. so when it sees a specific alert it just placed the corresponding color file

#

there is deff alot more to it then just changing some CSS

fallen horizon
#

yes but the logo stays that colour till next alert goes

broken coyote
#

that is correct. a alert widget times out. it would have to be done from a normal widget

#

it could also even be the same animation over and over, and just a color filter applied to it i suppose

fallen horizon
#

which is why im thinking if you use CSS for each individual alert to change out the images for logo then it would be simpler?

#

a coded colour filter could be it as well true

broken coyote
#

it would have to have JS to capture the listener

fallen horizon
#

yes so a little more than CSS but seems like it would work? just need to work out how to link the code with the library. (its been like 4 years since i did this coding)

broken coyote
#

the pinned posts have all your answers

upper bough
#

Yeah like Boost say.. JS to make listen the event and bring your fx

fallen horizon
#

yea so a eventTarget.addEventListener()

upper bough
#

you got the idea.. but maybe a little more like :

#
    // fancy stuff here
});```
broken coyote
#

honestly, what your looking for has some what already made. on the "custom widget", its a event list. so it had all the JS basically done besides some small editing of it

upper bough
#

yeah i use the "event list" to start as well

sand igloo
#

How do you tell if someone who sent a message is a follower?

mild cipher
sand igloo
#

Okay, thanks. Is it possible to get and spend loyalty points in a widget?

mild cipher
#

Get points, yes. Remove points from users, also yes, but requires your JWT token, which is like a combined username and password, so you shouldn't have it out in the open in your widget (i.e. where editors can see it). If you don't have any editors and this widget is purely for yourself, and you know the risk, then you're good. Docs are in this channel's header

broken coyote
#

!dong

mild cipher
#

(Alternatively external scripts with controlled access works.)

sand igloo
#

Okay, Thanks!

maiden dragon
#

how do I reference to have a webm file display in a custom alert?

#

If anyone would be able to code the alert for me for some $ feel free to reach out 😄

viral patrol
maiden dragon
#

thank you so much!!

waxen karma
#

hi there, how do i find the https address for an audio clip that i have uploaded into streamelements?

pseudo siren
#

@waxen karma Try right click on the sound in SE library.

waxen karma
#

@pseudo siren thank you for replying, i have been trying to do that but the options are only this

pseudo siren
#

Browser?

waxen karma
#

firefox

mild cipher
#

You can open your media library, go to sounds, press Ctrl + Shift + E to bring up the network tab, then play the sound effect and it should pop up there with the link

waxen karma
#

thank you @mild cipher (love your widgets btw), im around the mark but cant find the address

mild cipher
#

Thanks! Lol. Did you play the sound? If it still doesn't appear, then you might need to refresh the page and bring up the network tab before clicking play, in case it was cached

waxen karma
#

nope 😦 tried loading it into alert and playing, and just playing from media library after refreshing

#

so if the media was already in an alert (or overlay) its cached and wont show

#

i got a different file to play and show the mp3

mild cipher
waxen karma
#

@mild cipher you are amazing... if i wasnt married you would be in trouble... thank you.

maiden dragon
#

LMAO

#

anyone have a widget that looks for spesific text in chat? I have a !page {message} command in chat that allows users to page me and my stream deck will blink red with the message they provided. would love to implement this into the stream too somehow

steady iron
#

@maiden dragon you just need to evaluate the text on each message received, I do it like this:
window.addEventListener('onEventReceived', function (obj) {
let message = data["text"];

And from there you can just check if a certain string is in the message variable

maiden dragon
#

ye, currently trying to get it to show whatever text is after the page command on stream too 😄

steady iron
#

if you have spaces, you can split the message

maiden dragon
#

ye! the include would work well

steady iron
#

For example I do this:
var command = message.split(" ")[0];
var soname = message.split(" ")[1];

viral patrol
#

Also remove characters like ,.?! if you are going this way

#

If you want to check if somebody typed Kappa and Kappa! should be detected as well

steady iron
#

To remove stuff, you can use something like this, I use this specifically to remove "@"
soname = soname.replace(/[@]/,'');

maiden dragon
#

ye, can regex rite?

steady iron
#

yep

#

also, I suggest making everything lower case when comparing, so the text comparison do not fails due to one character being upper case

maiden dragon
#

Hm, ye that would probably be an good idea

viral patrol
#

let message = data["text"].toLowerCase().match(/(\w+)/g)

#

OK. Like that

maiden dragon
#

any of you that have coded some really unique Widgets?

#

I love new ideas to use these things and see what others have created / come up with

viral patrol
#

You can create really complex things with our editor

maiden dragon
#

Not looking to fill my own stream with a lot of stuff since I love minimalism, but the possibilities here are unlimited

#

Indeed

viral patrol
#

I wrote a full game in it.

maiden dragon
#

a friend of mine and me are looking into drawing animations with code only

viral patrol
#

Just to test myself 😉

#

(Code is terrible when I look back)

maiden dragon
#

haha, isnt it always when you just wanna test somethings possibilities haha

steady iron
#

I have one good one published, and a few custom ones I have made on commission that are not public. It is not terribly complex, its called Awesome shoutout

maiden dragon
#

looking back at stuff I've coded over the years its all a mess since I've never gotten into coding fully, I just understand it and learn as I go along

#

@steady iron ye I've seen that one around

#

doesnt have to be complex to be good tho 😉 the simpler the better a lot of times

steady iron
#

it started quite simple, now it has grown quite a lot

pulsar willow
#

So i ran into a Problem trying to reduce my Sources in OBS, I want to have my Overlays in one Overlay. But, how on earth do I add a widget that was made by someone else in one Overlay?

#

I do not want to copy the code

maiden dragon
#

copy the code is so easy tho? Just requires 4 copies

rugged rapids
pulsar willow
#

You sure?

steady iron
#

^^^^^

maiden dragon
#

does that one allow you to copy it over to other widgets? 😮

steady iron
#

It copies an object, if that object is a custom widget, should do the trick

maiden dragon
#

oo, didn't know thats how it worked

steady iron
#

correction: it actually duplicates the entire thing, into the overlay you want

maiden dragon
#

Ye, just tested it

pulsar willow
#

Ahhh. Thanks guys

#

Gonna try now

#

But if I were to Copy the object, how would I paste it?

#

Figured it out. Thanks guys :D

maiden dragon
#

good luck! 😄

pulsar willow
#

What's the difference between mod and supermod

elfin carbon
#

Supermod basically gives char control to boot the bot LUL

#

Chat

#

Soooo I want to expand the available responses to a given command using random.pick and an external raw file with ; delimited values... API call? (No external script rn...) Or fetch? Or json? Lol sorry... New to Python

viral patrol
inland igloo
#

So Ive been having this issue with a gifted sub event in the event rotator by CO6studios and I cant tell where the gifted subs data is being pulled from becuase it isnt within the Data library.

#

is it a data collection issue?

viral patrol
#

From what I see it is grabbed from obj.detail.session.data['subscriber-gifted-latest'] on widget load and then from real time events

crude tendon
#

anybody know why the tabs on the left side of my streamelements wouldn't be there?

indigo flume
#

Unrelated to the channel, but make sure you are using anything else different from Edge and its updated to the latest version

crude tendon
#

ope, sorry. Which channel should I post in regards to the actual site?

indigo flume
#

I mean, this channel is used for community members to talk about our API, not dashboard UI issues.

#

and etc

#

but the advise abotu the browser is still valid regardless

crude tendon
#

Yeah, I just wanted to know for future reference lol. Thank you!

fallen horizon
#

so im using the custom widget event list. how do i swap out the follow badge for a gif ive uploaded to my library? i have tried replaced the CSS with this <https:// streamelements.com/uploads/Follow-Blue.gif> as i do not see where the badge is linked in the JS file

#

@velvet cave still no luck on the remote parameters stuff? 😦

velvet cave
#

I have not been online for today yet sorry! Had some house seeings, I will double check with staff when I get home!

#

Maybe in the new time someone else can take a look, I'll ask around for ya

viral patrol
fallen horizon
#

yea ive amended that code and its not affected anything. so i think either my link is wrong or it doesnt work

viral patrol
#

If you open that URL in browser - do you see an image?

fallen horizon
#

ive inserted the gif and then opened the image in a new tab and copied that URL. it has now led to a white circle in place of the follow badge

hardy walrus
#

What does the console tab in developer console say for the link?

fallen horizon
hardy walrus
#

I mean for tthe link in a new tab. Not in editor.

fallen horizon
#

im not understanding what your asking. when i open the image in a new tab theres is nothing in console

knotty thorn
#

@fallen horizon he means for the url of the image - so paste that into the address bar and see what comes up in the console

fallen horizon
#

i did. theres nothing in console.

hardy walrus
#

And does the image so in the browser like a direct link?

fallen horizon
#

yes the image shows when imported into the editor and then opened in a new tab.

#

my plan is to remove the text and bars altogether and keep just the badges for each event.

languid wigeon
#

Could you please add Text called Sparkles to the streamelements alert text ?

hardy walrus
#

@languid wigeon If it's a Google font you can specify it yourself within the code..

languid wigeon
#

how

#

never done it

broken coyote
#

@fallen horizon i tested that link to the image, and its not working for me. not sure where you got it from

hardy walrus
#

Can you answer this Boost?

broken coyote
#

you will need a woff of the text you want

fallen horizon
languid wigeon
#

ive downloaded the font but yeah no idea

broken coyote
#
@font-face {
  font-family: 'fontnamehere';
  src: url('linktofont.com/genxfiveblocker-webfont.woff2') format('woff2'), /* Super Modern Browsers */
       url('linktofont.com/genxfiveblocker-webfont.woff') format('woff') /* Pretty Modern Browsers */
}
#

let me look @fallen horizon

languid wigeon
#

do i need copy that in box ?

broken coyote
#

no, thats just how you do it

languid wigeon
#

where do i do that

broken coyote
#

that gets placed in the css

languid wigeon
#

ok ive enabled custom css its open the box do i have to delete everything in that and replace it with box you did

#

?

broken coyote
#

i just sat down at my desk so im not fully awake... but @fallen horizon the image you are replacing is a svg. so its currently set up for a svg/mask.

#

what is the font

fallen horizon
#

right so ill need to completely replace the css setup. ok. i think nerdordie have some CSS that could work

languid wigeon
#

Sparkles its certain type i do have the link if you need it

broken coyote
#

i do

languid wigeon
#

want send it in dm ?

broken coyote
#

no

languid wigeon
#

post it here then ?

broken coyote
#

yea

languid wigeon
broken coyote
#
.event-follower {
    background-image: url('https://cdn.streamelements.com/uploads/7881997f-68ad-40d1-9ee2-755f1e7c73f6.gif');
    -webkit-mask-image: url('https://cdn.streamelements.com/static/custom-event-list/follower.svg');
}

@fallen horizon

#

@languid wigeon they dont have a hosted woff & ttf. so you would need to host it somewhere

languid wigeon
#

what you mean by host it some where

broken coyote
#

the file online

#

they dont off a woff. so u wouldnt be able to use it anyways

languid wigeon
#

ok thanks anyways

fallen horizon
#

thanks @broken coyote thats worked great and thanks@hardy walrus for helping out too

broken coyote
#

no problem

fallen horizon
#

ok so every single badge works aside from the green (donations/cheers) badge. it is linked in using same code you gave me boost

broken coyote
#

shoot me the link for that one

broken coyote
#

?

#
.event-tip {
    background-image: url('https://cdn.streamelements.com/uploads/bf131b8c-7833-40f4-a753-d36beab78921.gif');
    -webkit-mask-image: url('https://cdn.streamelements.com/static/custom-event-list/tip.svg');
}
fallen horizon
#

I dunno why mines wasnt working.i had the same code in that you had

hardy walrus
#

Maybe bad cache?

broken coyote
#

"wasn't"... is it now?

fallen horizon
#

yes its now working. just now getting rid of the wee symbols(star, heart, arrow etc)

simple cove
#

I’m hoping I am asking in the correct area, but I am a little lost trying to figure out some custom alerts. I am currently in the process of having some made, but I am trying to locate a source for the coding. As I am aiming to have my alerts appear in the bottom of the camera - anybody point me in a direction of some source material? Please.

broken coyote
simple cove
#

Thank you, I will stick my head that was and see if I can make head or tail of it. I admit it’s my first attempt, so I may get lost

spare knot
static wigeon
#

@spare knot please make sure to set the correct content-type.

#

application/json

spare knot
#

@static wigeon i tried, but not there are error "name 'options' is not defined"

mortal swallow
#

Hello guys i am new to the streaming stuff, and as a developer irl i though why not develop my own stuff, but i am getting a hard time to understand how the custom widget stuff work, any place i can figure out, to start learning basics and climb

indigo flume
mortal swallow
#

sorry i found that as ended the msg, just look up

#

i'm so sorry

#

tkx @indigo flume 🙂

indigo flume
#

no probs

light oracle
#

Hey so I cant upload any photos to the editor on streamelements

#

That's what I get even tho it's in the right formats

rugged rapids
#

@light oracle Please keep the conversation in one channel. Thank you.

real dune
#

is it possible to get a subscriber label for twitch that
shows the names
can be set for the stream session
and has all the standard text animations

there isnt a label that does all of these

broken coyote
#

It is possible

eager ginkgo
#

Hey Mr. Lawyer, you know anything about the SE Mixer integration on the NoD UpLink package?

broken coyote
#

I just read off that

inland igloo
#

@viral patrol im within the editor of the Roatator by CO6studios and am still having a hard time figuring out how to make the "subscriber-gifted-latest" event separate from the "latest sub" event. Im trying to make it show the sender of the gifts and how many gifts sent, and also have the rotator show the latest subscriber that wasnt a gift. Is it possible

#

sorry for the late response

eager ginkgo
#

Thanks @broken coyote SEHug

#

Someday I should really learn how to leverage the power of an API

broken coyote
#

Console.log(obj); is your friend

shell tree
#

curl -X GET ''

iron heart
#

Hello! I am looking for a widget similar to what Jameskii uses on his streams that shows the amount of messages and emotes used during the stream, as well as an emote combo counter. I can dm a timestamped video link to show what I mean if needed.

shell tree
iron heart
#

Thank you Mitch.

shell tree
#

😉

noble girder
#

Hey does anyone know if theres a way to run math through a {count} variable in the overlay editor? I'm trying to subtract 1 from my total sub count

mild cipher
#

@noble girder $(customapi.api.mathjs.org/v4/?expr=$(channel.subs)-1)

noble girder
#

@mild cipher does that work for overlay editor?

waxen karma
#

@mild cipher hi there, i am using your recent event rotator. i would like to align the text to the right of the field, which i have been able to do in the overlay, but in obslive it appears to the left or center. @indigo flume suggested i contact you directly for assistance.

viral patrol
#

@noble girder For overlay editor you might want to use custom labels widget from our github and change line https://github.com/StreamElements/widgets/blob/master/CustomLabels/widget.js#L30
FROM:

            $(".main-container").html(data[eventType]["name"] + " X" + data[eventType]["amount"]).toLocaleString(userLocale);

TO:

            $(".main-container").html(data[eventType]["name"] + " X" + data[eventType]["amount"]-1).toLocaleString(userLocale);
noble girder
#

Lmaoo I guess that would work

broken anchor
#

Hey guys hope everyone is doing well, just wondering if its possible to create a chat command that will earn loyalty points at a 50% chance rate? for example (!earn) will then generate a number from 1-100 : if the number is between 1-50 they will earn X amount of "loyalty points" : if its between 50-100 they get nothing. That would give them a 50% success rate. Do the variables offer such functionality?

PS : I got this far
${random.1-100} - to be used to generate the number
!givepoints ${user} 100 - to reward the user 100 points (hoping i can use a variable for this too)
${count - i feel like i can use a count variable to verify if the number is between 1-50 but not sure which one to use

i tried in the twitch helpdesk and was referred here, Hope you can help! 😄

mild cipher
#

@waxen karma on line 10 of the CSS, change this to justify-content: flex-end;

#

@broken anchor there aren't any variables that can add points to users, so the best you can do is have the random number generator command and then have a mod manually give points if the number is 1 - 50. You can give the command a very long user cooldown so that they can only do it once every X hours.

broken anchor
#

@mild cipher hmmm ok so i cant give points automatically, but can i out put a simple message like "you have found x ${pointsname}" or "you got nothing" instead of displaying the number?

mild cipher
#

You can do that. If you don't mind quotation marks around the response (due to the nature of the customapi you can't remove them) then you can use this:

$(customapi.https://api.mathjs.org/v4/?expr=$(queryencode 'floor(random()*100)+1 > 50 ? "You got nothing!" : "You found 500 points!"'))
#

(Otherwise there's another possible customapi but eh)

#

Actually the other customapi would be easy since it's 50/50

viral patrol
#

You can achieve the same with default ${random}

mild cipher
#

True LULW

viral patrol
#

Overengineering - I know that feeling 😉

mild cipher
#

${random.pick 'You got nothing!' 'You found 500 points'}

waxen karma
#

@mild cipher 👍 thank you, works great

broken anchor
#

oh damn nice, the custom api seems very powerfull i should look into that more ! but like this we can control the success rate too 😄

viral patrol
#

You can alter success rate here too!

#

Do you want 25% chance of winning? ${random.pick 'You got nothing!' 'You got nothing!' 'You got nothing!' 'You found 500 points'}

charred tundra
broken anchor
#

ohhhhh i get it 😄

#

sweet, yeah that makes it really simple actually haha

#

now i just wish the output can be !givepoints ${user} 😖 but no worries, thanks for the help guys !

mild cipher
#

To prevent creating black holes, the bot can't trigger itself I'm afraid

broken anchor
#

i can see how it could create a never ending loop yeah 😦

#

might crash the bot in bulk i assume

#

either way thank you for the lesson and info 😄

hardy walrus
#

If you don't mind using another bot as a mitm....

broken anchor
#

oh

#

actually

#

got some braniacs here i see yogevThink

hardy walrus
#

I just know when to think outside the box 🧠

viral patrol
#

Ohhh. About another bot - I think twitch is against that.

#

Bots shouldn't interact with each other

hardy walrus
#

I wouldn't blame them if it is but I'd assume minute and small usage would be "okay".

unique mountain
#

I was wondering if there is like any Documentation over Widget variables?
Im Trying to get my Recent Cheers to do the same as my Latest Cheer Widget. Is that possible? to get the bit Emojis to animate like that?

quasi vale
#

I'm editing my overlays and I want to change the duration of the overlay but when I change it to 5 seconds the text is up for 5 seconds but the animation is still up for 10 seconds. How do I make the animation the same time as the text duration?

viral patrol
trim gate
#

@simple wraith been a bit since i asked you to take a peek at the way the step goal widget was working. have you seen what i was talking about as far as it doing step highlighting and such?

simple wraith
#

@trim gate i can't find a way to emulate sparks/embers in SE widget, @mild cipher has added some of that functionality and i can't find it in the converted code. Fyre, can you check how/why embers/sparks are not working? Mixer stuff is beyond me

mild cipher
#

@trim gate can you send me an editor invite link to your mixer account?

trim gate
#

sent

#

sorry for it being 2 hrs later. appointment afk.

kind vessel
#

I got a problem importing from DeepBot to StreamElements. What I did: Open DeepBot (I have a VIP account and it is still active). Go to the options and get my security key.

Then go to my StreamElements Import page and click on Import Now (DeepBot) and put in my DeepBot API Secret and click Import now. DeepBot is still active.

It tells me that it is loading in users and 1 second after that I get a screen with "Loading 14041 users...." and 2 buttons. Back and Retry. Even with waiting for an hour nothing happend.

#

I only got a couple of days left on my subscription on DeepBot and hope this can be fixed before it ends. 😦

wind elm
#

hello, i'm using this widget https://strms.net/on-screen-commands_by_zanzer but the videos that play from commands that are larger res than the stream play at their native resolution and I don't know how to scale them, anyone knows how to fix?

lean jay
mild cipher
#

@lean jay use your StreamElements channel ID instead of channel name

steady iron
#

@crude crest your help is required by @wind elm

crude crest
#

Thanks Rene :)

pulsar willow
#

Hello fellows, nice to meet you. I have a doubt. Is there any way to do custom alerts via API? It's for a "custom" payment method.

viral patrol
pulsar willow
#

thanks, @viral patrol

lusty portal
#

So I've been using https://cors-anywhere.herokuapp.com/ to forward from streamelements to my server (because my server is using http instead of https). I use the following code..

        var xhttp;  
        xhttp = new XMLHttpRequest();
        xhttp.open("GET", "https://cors-anywhere.herokuapp.com/http://www.5thWallGaming.com/TwitchChatbot/index.cfm?Hours=0&Username="+username+"",true);
        xhttp.setRequestHeader("Origin","StreamElements.com");
          xhttp.send();

but this still fails. Any thoughts on how to get it to work again?

broken coyote
#

@lusty portal

#
var username = 'mrboost';
var url = "https://cors-anywhere.herokuapp.com/https://twitch.api.scorpstuff.com/affiliate.php?user="+username+"";
function corsanywhere() {
  var xmlHttp = new XMLHttpRequest();
  xmlHttp.open("GET", url, false);
  xmlHttp.send(null);
  var result = xmlHttp.responseText;
 console.log(result);
}
corsanywhere();
#

i always know im wrong, or did it the hard way if i see "lx is typing"

viral patrol
#

This one might get glitchy:

        xhttp.setRequestHeader("Origin","StreamElements.com");

as not every environment allows you to set this header

#

And your function I would do different way to make it AMAZING.

#

Like AMAZING

broken coyote
#

like.. turn the roomba on amazing?

viral patrol
#
function corsanywhere(url) {
  var xmlHttp = new XMLHttpRequest();
  xmlHttp.open("GET", url, false);
  xmlHttp.send(null);
  return xmlHttp.responseText;
}

var username = 'mrboost';
var url = "https://cors-anywhere.herokuapp.com/https://twitch.api.scorpstuff.com/affiliate.php?user="+username+"";

let response = corsanywhere(url);
console.log(response);
broken coyote
#

lol you would

viral patrol
#

This way you don't have to alter global variable, but you can corseanywhere("http://afa.asdfgsdg.su/?something=big")

eager ginkgo
#

legally I don't believe you'd be allowed to do that....I would have to ask my lawyer

lusty portal
#

When I do that, I get an error saying that I need to add an origin header.

broken coyote
#

according to the javascript law 1032c.10... i'll allow it

viral patrol
#

One moment

lusty portal
#

"Missing required request header. Must specify one of: origin,x-requested-with"

broken coyote
#

whats the username you are piping in?

lusty portal
#

Lance_Lake

#

Actually, it's pulling from the event.

#

For the example, it should say "Hey.. @Lance_Lake. Something went wrong pulling up the Action."

viral patrol
#

@lusty portal


const getCors=(url)=>{
    return new Promise(function(resolve, reject) {
        fetch(`https://cors-anywhere.herokuapp.com/${url}`,{headers:{'x-requested-with':'xhr'}}).then(resp=>resp.text()).then((data)=>{
            resolve(data);
        });
    });
}


let url="https://twitch.api.scorpstuff.com/affiliate.php?user=JustATest";
getCors(url).then((data)=>{
    console.log(data);
});
broken coyote
#

it does

lusty portal
#

But it doesn't seem to pass it along.

#

So... I populate the "let url=" with the URL I want it to go to?

broken coyote
#
var username = 'Lance_Lake';
const getCors=(url)=>{
    return new Promise(function(resolve, reject) {
        fetch(`https://cors-anywhere.herokuapp.com/${url}`,{headers:{'x-requested-with':'xhr'}}).then(resp=>resp.text()).then((data)=>{
            resolve(data);
        });
    });
}


let url="http://www.5thWallGaming.com/TwitchChatbot/index.cfm?Hours=0&Username="+username+"";
getCors(url).then((data)=>{
    console.log(data);
});
lusty portal
#

I can't pretend I'm not confused by this.. But I'm trying to fit it into what I have already written. BRB.

#

Nope.. That didn't work.

viral patrol
lusty portal
#
window.addEventListener('onEventReceived', function (obj) 
    {
        if (!obj.detail.event) {return;}

        const event = obj.detail.event;
  
        if (typeof obj.detail.event.itemId !== "undefined") 
            {obj.detail.listener = "redemption-latest"}

  
        const getCors=(url)=>
            {
                return new Promise(function(resolve, reject) 
                {
                    fetch(`https://cors-anywhere.herokuapp.com/${url}`,{headers:{'x-requested-with':'xhr'}}).then(resp=>resp.text()).then((data)=>{
                      resolve(data);
                    });
                });
            }

        if (event.type === 'follower') {addFollowEvent(event.name);};
    }
    );

    function addFollowEvent(username) 
    {
        let url="http://www.5thWallGaming.com/TwitchChatbot/index.cfm?Hours=0&action=Event&Username="+username+"&Password=RemovedForSecurityReasons&Type=Follow";
        getCors(url).then((data)=>{console.log(data);});  
    };

#

That's the full code.. So is streamlabs blocking something?

viral patrol
#

Do you want to display it in the widget instead of console?

#

If so - replace console.log(data) with something that puts data in widget

lusty portal
#

I want it to go to that URL when that action (follow) happens.

#

This is a seperate layer that is hidden.

#

It was working as I had it before 1-22-2020.

#

Then it stopped working.

#

So something changed.. It's nice to know I wasn't blacklisted or some such, but then streamelements must've did something different.

viral patrol
#

But can you see information in console?

lusty portal
#

Can you show me how to see the console on the editor in streamelements? 🙂

viral patrol
#

CTRL+SHIFT+J

lusty portal
#

.....

#

It writes to my own console....

#

I never knew this..

#

.....

#

Ok... I may be able to figure this out then..

#

Give me a sec...

viral patrol
#

Alertbox doesn't write to console, some time ago custom widget didn't write there as well

lusty portal
#

Working now.. Sending it twice, but I'll work that out.

#

Thank you. 🙂

pulsar willow
#

Hey LX, your "Latest Youtube Video" widget animations dont play in the overlay editor

viral patrol
#

Checking it now.

pulsar willow
#

Alright

viral patrol
#

Seems working for me when using StreamElements channel

pulsar willow
#

My Browser's Hardware accel is enabled

viral patrol
#

I think I have the same enabled as well. Maybe your uBlock/uMatrix or other js/css blocking addon blocks animations plugin?

pulsar willow
#

Lemme try disabling them

#

They are disabled but nothing changed

viral patrol
#

Does it work in OBS?

pulsar willow
#

Nope

viral patrol
#

Can you dm editor invitation link to your account so I can investigate it directly there?

pulsar willow
#

Of course

lusty portal
#
const getCors=(url)=>
{
    return new Promise
    (
        function(resolve, reject) 
            {
                fetch(
                        `https://cors-anywhere.herokuapp.com/${url}`,
                        {headers:
                            {'x-requested-with':'xhr'
                            }
                        }
                    )
                    .then(resp=>resp.text())
                    .then(
                        (data)=>{resolve(data);}
                        );
        }
    );
}

window.addEventListener('onEventReceived', function (obj) 
{
    if (!obj.detail.event) {return;}
  
      const event = obj.detail.event;
  
    if (event.type === 'follower') {addFollowEvent(event.name);};
    
}
);

function addFollowEvent(username) 
{
    let url="http://www.5thWallGaming.com/TwitchChatbot/index.cfm?Hours=0&action=Event&Username="+username+"&Password=RemovedForSecurityReasons&Type=Follow";
    getCors(url).then((data)=>{console.log(data);}); 
};

Ok. I give up. Why is this sending 2 URLs?

broken coyote
#

is it sending the same thing twice?

lusty portal
#

Yes

#

An exact double.

#

from the same second to up to 3 seconds later.

broken coyote
#

only sends once for me

viral patrol
#

Maybe you have this overlay twice in OBS?

lusty portal
#

I don't think I do.. But I will doublecheck..

viral patrol
#

As separate browser sources

#

Or....

#

You have it in obs and editor is still open

broken coyote
#

ugh. obs.live need a test button

viral patrol
#

I usually click "replay"

lusty portal
#

Will that do it?

#

I have OBS and the editor open.

#

facepalm

viral patrol
#

3 hours of debugging?

broken coyote
#

lol

lusty portal
#

Yeah.

#

yeah..

#

It works now...

hardy walrus
#

Do you have a rubber ducky sitting with you?

lusty portal
#

LOL

broken coyote
#

been there done that

lusty portal
#

This is not my first time.

broken coyote
#

and wont be the last

lusty portal
#

Thanks to both of you for the help.

broken coyote
#

no prob cap'n

viral patrol
#

I hope you didn't killed yourself by facepalm. I was pretty close of doing so few times when I did simple mistakes 😉

lusty portal
#

No.. I'm still alive.. Though dizzy.

#

I had a sandwich made and I'm going to go watch youtube now and try to live off this shame. 🙂

viral patrol
#

Just check if you have a sandwitch on your plate and there is no other sandwitches left in kitchen, in the fridge and so on 😉

sand igloo
#

Is there a way to have a custom widget in multiple overlays but edit the code for all instances?

rugged rapids
#

Not that I am aware of. You would need to copy the widget to the new overlays.

sand igloo
#

So, if I have a widget that I want to have different field values on each overlay to update the code for all of them I have to pretty much copy the new widget with code and just re input the fields?

rugged rapids
#

Afaik, yes.

sand igloo
#

I'm trying to do a simple request in the API but I keep getting a "error":"Unauthorized","message":"invalid token"

mild cipher
#

What does your request look like? Minus the token of course

sand igloo
#
    let data = {message: "I'm a bot!"};
    let 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/"+owner+"/say");
    xhr.setRequestHeader("accept", "application/json");
    xhr.setRequestHeader("content-type", "application/json");
    xhr.setRequestHeader("authorization", "Bearer '"+JWTtoken+"'");

    xhr.send(JSON.stringify(data));
#

It's in Javascript

mild cipher
#

There shouldn't be any quotes around the actual token, it's just Authorization: Bearer XXXXXXXX

#

So "Bearer " + JWTtoken

sand igloo
#

With the quotes i get {"statusCode":401,"error":"Unauthorized","message":"invalid token"}
Without the quotes i get {"statusCode":403,"error":"Forbidden","message":"No channel authorization found"}

mild cipher
#

What are you using for owner?

#

If you're using the channel name, it should be StreamElements channel ID

sand igloo
#

my channel name 'necrotheif'

#

Which is also that

#

I get the same results when I type it like https://api.streamelements.com/kappa/v2/bot/necrotheif/say

mild cipher
#

You'll want 5e2ce7b63eae7d9a6e6fbb6c

sand igloo
#

Yay! Thanks! That worked!

mild cipher
#

Please keep in mind the security risks if you're doing this inside a custom widget by the way, as any editors with access to your account and overlays will be able to find your JWT token in your widget, which is basically your account's password. If you have no editors and this widget is only for you, then you're probably okay

sand igloo
#

If you have no editors and this widget is only for you, then you're probably okay
^ That is my current situation but is there a way to do it that is safer?

#

Oh, and I have the JWT as a field so if I share it, it won't have that. right?

mild cipher
#

I'm afraid you wouldn't be able to share any widget that requires another user to put their token in a custom field- they could have editors or give editors access in the future and their entire account is then compromised.

#

A much safer approach is to use the oauth2 flow. The bot:write scope gives you access to these bot endpoints. You can apply for access here: https://strms.net/oauth2_request

sand igloo
#

Ah, so if It got approved for that I could have bot integration with a widget and share it?

mild cipher
#

Sure. You would need to be able to securely store the user tokens, then you can act as a man-in-the-middle between tokens and the widget, with controlled access

sand igloo
#

Ohhh... Okay. Got it. Thanks!

patent ore
#

I couldn't find any channel dedicated for help with the overlay editor, is it alright to ask here?

mild cipher
#

If it's custom code related then here is good, otherwise you'll want the helpdesk for your platform

pulsar willow
#

Hey @broken coyote Can I make your widget show one goal?

broken coyote
#

you can. set the ones you dont want to show to 0

pulsar willow
#

Alright thank you

broken coyote
#

no problem

lusty portal
#

Anyone notice a problem with alerts?

#

The sample alerts work fine and as of 3 hours ago, worked fine when they triggered...

#

But now, cors isn't sending data anymore.

broken coyote
#

you have a ton of issues with that thing lol

lusty portal
#

Yeah.. I know.

#

I wish there was some other relay I could use or I wish streamelements would let me send data to http addresses.

#

I think I just need to drop some money and hire someone to make my VM accept https and then I can just go directly to the server.

boreal cedar
#

@zenith folio get in touch with caffeine.tv and start working on offering stream alerts there. We neeeeed it.

high swallowBOT
#

@boreal cedar 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.

inland wagon
#

Can someone explain the difference between bulkGifted and gifted ?

charred tundra
#

I believe bulkGifted is for when someone gifts multiple subs at once

indigo flume
#

^

#

gifted is basically the same, but for 1 individual sub event

#

but then again if that sub event is a bulkGift then you need to find its amount to see if its 2 or 1000 gifted subs

inland wagon
#

but gifted is always true no matter how many he gifted right now, right?

indigo flume
#

yes

#

so if you are looking for the community gift -> if gifted === 'true' && bulkGift === true => do stuff

inland wagon
#

why do you need to check bulkGift then?

#

if he gifted 1 sub won't it be false?

indigo flume
#

if you are doing a sub counter why have it increment by 1

#

when you can just add that specific amount?

#

it will be false, thats why you have the else if

inland wagon
#

I am trying to figure out how to get the number of subs one person gifted over the last month

indigo flume
#

ah thats different

#

we do not have a way to track that or provide it via the custom widget api

inland wagon
#

data["subscriber-gifted-latest"]["amount"] This one is only how many he gifted at one particular time correct?

#

hm

indigo flume
#

that should be the all time one

#

for counts we have recent gifted and all time gifter

inland wagon
#

I am looking at a custom widget right now that can rotate the text between all follower of the past 2 weeks, all subs of the past 2 weeks etc.
Shouldn't it be possible to do that for gifted subs?

indigo flume
#

I don't believe you can iterate through the aggregates based on time, only via pages or the last X followers/subs

#

unless im remembering incorrectly, some of the code gurus might be able to answer that properly

inland wagon
#

I am not 100% sure how this script here works, but I think it detects sub events, follow events etc. and then adds and saves them. Then the widget selects only values from events that happened in the past 2 weeks

#

I might be completely wrong

#

Is there some kind of console where I can log?

indigo flume
#

F12

inland wagon
#

thanks

inland wagon
#
  "giftedSub": {
    "type": "dropdown",
    "label": "Gifted subs only?",
    "value": "yes",
    "options": {
      "yes": "Yes",
      "no": "No"
    }
  },
#

I have this in my Fields

#

and I set it in the widget UI to 'YES'

#

but whenever I check if it is yes, it returns false

#

if(prefs.giftedSub === 'yes')

#

what am I doing wrong?

#

nevermind

#

I found the answer lol

indigo flume
inland wagon
#

If I have a name of someone, how do I get the total amount of subs they gifted, ever?

#

Should I iterate over obj["detail"]["session"]["data"]["subscriber-alltime-gifter"] ?

viral patrol
#

This one is not iteratable AFAIK. It contains just one person.

#

Unfortunately there is no aggregate over shorter periods.

inland wagon
#

So I cannot get the total subs they gifted?

viral patrol
#

You cannot find how many specified person gifted, you can only check who and how many subs were gifted by the #1 sub gifter

inland wagon
#

hmm

#

gifted seems to be false if more than 1 sub is gifted at a time

#

or rather, if I try to do "community gift" thing to test multiple gifted subs

#

I don't understand when that would be triggered

kind dock
#

any one have a great way to have custom alerts triggered from external website, going through the API docs and can't seem to find anything. lets say i have a shop and when some one buys stuff there i want to trigger an alert on stream, any one have some examples or anything i can work from?

simple cove
#

Anyone know how to program a countdown timer? I have one for my starting soon screen and would like it to countdown from 5 minutes to zero. Resource point or advice would be amazing

viral patrol
#

@simple cove We have a default countdown widget you might use. No coding required.

#

@kind dock The only ways I can think of is to connect to websockets on your server and listen to events or fetch last order list via REST API every X seconds and display new orders. Some shop services offer webhooks requests as well, so you can use "webhooks to websockets" services and use them.

kind dock
#

So there is no way to hook into the merch alert like we can hook into the tipping system ?

viral patrol
#

I think that the best way is to use webhooks to websockets. It would be "almost" like the tipping I helped you with, but widget will connect directly to websockets, without adding activity to feed.

kind dock
#

i think i need to have a look at this when i'm not sick, because it makes no sense right now how i should go about it

simple cove
#

@viral patrol hmm. The widget sounds good, but I wonder how customisable it is.

viral patrol
#

You can define font settings and time, that's for sure.

steady horizon
#

hi. does anyone know what i could be doing wrong. i have uploaded my own image for my follower/ donation and ive created a widget for just follower for the moment and have erased the animation only want the txt but when i try to emulate nothing shows up.i have also made sure that that file is above the image file to display butr nothing shows

#

im sorry im very new i dont understand

velvet cave
#

Captain, he is talkking about something else i reckon, I'll ask LX if he can help you out

inland wagon
#

yeah sorry about that

steady horizon
#

all good

viral patrol
#

Hi! I think that you need to use custom code for that. Just toggle "Enable custom CSS" then "Open editor" and remove this part:

#

Oh. Neverming. Found an actual solution 😉

#

The default widget text settings have -50 as top margin (Text settings => Advanced). Change it to 0 and you should be able to see alert text.

#

@steady horizon

steady horizon
#

thanks will check it out

inland wagon
#

Can I write a twitch bot in C# and somehow interact with StreamElements widgets from that bot?

#

I've come across a lib for C# that uses Twitch API

viral patrol
#

What interaction you need?

#

As there might be no need to write anything external, as custom widgets can listen to chat on their own.

inland wagon
#

First I need the ability for command parameters (for example !poebot sunder where sunder is a string fetched by the bot if possible), then I need to get data from the path of exile wiki, and I'd be more comfortable to do all this in C# as I have no experience in javascript. Then, ideally the fetched data should pop up on stream as a widget for X amount of time. ^^

#

So you can get info about skills from a wiki by asking the chat bot, then it shows up on stream

#

If this is all possible within javascript/streamelements that'd be good too

viral patrol
#

Oh... Scraping a website via JS in frontend would have a lot of limitations. If you have any place that will give you text response for call https://test.test/?term=sunder, it would be possible. But wiki is whole xhtml, so grabbing that would be problematic.

#

Text response or JSON object would be the best for that.

inland wagon
#

the poe wiki uses the mediawiki API https://www.mediawiki.org/wiki/API:Main_page

#

not sure if this would work

viral patrol
#

The best I could find with it is: https://pathofexile.gamepedia.com/api.php?action=query&prop=extracts&exsentences=10&exlimit=1&titles=Sunder&explaintext=0&formatversion=2&format=json

inland wagon
#

that seems to be everything packed into one string but if it only works like that it's fine I could split that up I guess

#

how did you get that?

viral patrol
#

I took a look at API docs you gave me and prepared that example

inland wagon
#

ohhh

#

sorry I've never done web stuff.. I think I see what u did

#

Anyway, is it possible to call javascript stuff in Streamelements from C#?

#

That would make my work a lot easier

viral patrol
#

I think that could be possible. For example socket.io on both ends - one in JS (client) and one in C# (server)

inland wagon
#

hmm great!

viral patrol
#

But it still requires coding in JS to parse events coming from that socket. I think that the best way is just to write the whole stuff in JS.

#
const getCors = (url) => {
    return new Promise
    (
        function (resolve, reject) {
            fetch(
                `https://cors-anywhere.herokuapp.com/${url}`,
                {
                    headers:
                        {
                            'x-requested-with': 'xhr'
                        }
                }
            )
                .then(resp => resp.json())
                .then(
                    (data) => {
                        resolve(data);
                    }
                );
        }
    );
}
window.addEventListener('onEventReceived', function (obj) {
    const listener = obj.detail.listener;
    if (listener !== "message") return;
  console.log(obj.detail);
    let message = obj.detail.event.data.text;
  
    if (message.startsWith('!poebot ')) {
        message = message.replace('!poebot ', "").replace(' ', '_');
        message = message.charAt(0).toUpperCase() + message.substring(1);
        getCors(`https://pathofexile.gamepedia.com/api.php?action=query&prop=extracts&exsentences=10&exlimit=1&titles=${message}&explaintext=0&formatversion=2&format=json`).then(obj => {
            const text = obj['query']['pages'][0].extract;
            $(".main-container").text(text);
        });
    }
});
#

Something like that

#

@inland wagon ⤴️

inland wagon
#

woah thanks a lot

#

really appreciate it

viral patrol
#

You're welcome.

inland wagon
#

another thing I am not sure if doing correctly, if(data.gifted === false && data.bulkGifted === false && data.isCommunityGift === false) Is this the correct way to check if the subscription is NOT a gift and just a normal sub? Not sure if I need isCommunityGift here

viral patrol
#

I would do that like: if(data.gifted || data.bulkGifted || data.isCommunityGift) return;

inland wagon
#

kk

inland wagon
#

hmm how do I emulate a chat message?

broken coyote
#

one day. i hope to be just like lx

viral patrol
#

Just write chat message on chat. Don't be afraid to do so 😉

inland wagon
#

uhh there is no chat here lmao

#

I'm not a streamer

broken coyote
#

go to the page that account is attached to

inland wagon
#

oh thanks

#

with the code all I get is Object { listener: "message", event: {…} } in the console, but the widget doesn't change

#

event: Object { service: "twitch", data: {…}, renderedText: "!poebot sunder" }

#

is $(".main-container") not the current widget?

viral patrol
#

You should leave html untouched from default custom widget, remove CSS and FIELDS and it should be working.

inland wagon
#

ahh yeah the class was different

#

thx

#

Is it possible to keep new line characters in the text?

#

like, I don't think I can effectively split the string if it goes like this: 5% of Base Attack DamageShockwaves deal 60% less Damage+5 to radiusPlace into an item

viral patrol
#

Then create a virtual element of parse.text

#

Then extract something via DOMDocument

#

@steady horizon use FFMPEG to convert it to webm: ffmpeg -i currentFile.mov -c:v libvpx-vp9 -pix_fmt yuva420p converted.webm

steady horizon
#

I have no clue how to do that what do u mean?

broken coyote
#

u need FFMPEG

inland wagon
#

huh

viral patrol
inland wagon
#

I guess I should try going the C# route and communicating via sockets

#

talking to the wiki API should be easier

viral patrol
#

@inland wagon you will have same issue there - how to extract a part of DOMDocument to be displayed

steady horizon
#

Thanks @viral patrol

inland wagon
#

the wiki API can output json php xml txt etc.

#

so from what I understand I should be able to get properties easily rather than doing text parsing myself

viral patrol
#

Of course it can.

#

But in each output you will have same text.

#

It will just wrap an object into form you specify

#

For example XML:

inland wagon
#

lol

#

still would be much easier for me in C#

broken coyote
#

then do it in C#

inland wagon
#

yup

inland wagon
#

fuck

#

my gif gets deleted LUL

broken coyote
#

lol

viral patrol
#

OK. The last try, to show you how to extract needed part, as this seems to be easy:

const getCors = (url) => {
    return new Promise
    (
        function (resolve, reject) {
            fetch(
                `https://cors-anywhere.herokuapp.com/${url}`,
                {
                    headers:
                        {
                            'x-requested-with': 'xhr'
                        }
                }
            )
                .then(resp => resp.json())
                .then(
                    (data) => {
                        resolve(data);
                    }
                );
        }
    );
}
window.addEventListener('onEventReceived', function (obj) {
    const listener = obj.detail.listener;
    if (listener !== "message") return;
  console.log(obj.detail);
    let message = obj.detail.event.data.text;
  
    if (message.startsWith('!poebot ')) {
        message = message.replace('!poebot ', "").replace(' ', '_');
        message = message.replace(/^\w/, c => c.toUpperCase());
        getCors(`https://pathofexile.gamepedia.com/api.php?action=parse&page=${message}&prop=text&formatversion=2&format=json`).then(obj => {
            
          //There you can change whatever you want to display by class name, -gemdesc seems to be an excerpt
            const text = $(obj['parse']['text']).find(".-gemdesc").text();

            $(".main-container").text(text);
        });
    }
});
#

@inland wagon ⤴️

inland wagon
#

you're a hero

#

what types of elements does $(obj['parse']['text']) contain?

#

the class names?

viral patrol
#

It is the whole html from API call

#

You can see example above

inland wagon
#

oh okay

#

why is there a $ around the array?

viral patrol
#

$ is a jQuery so this assigment is is set text to value of jQuery element made from obj.parse.text

inland wagon
#

oh so it's a string

#

I'm trying to figure out how to get all occurences of -mod because there are multiple ones in the HTML

#

thought I'd use find() in a loop with substrings until the end of the file

viral patrol
#

Of course you can iterate over it

#

For example:

            let text='';
            $(obj['parse']['text']).find(".-mod").each((index,element)=>{
                text+=$(element).text()+"<br/>";
            });

            $(".main-container").html(text);
steady horizon
#

@viral patrol I tried to install ffmpeg but my cmd is not reconising it ive followed a youtube on how to install but nothing working this system isnt that easy to use

broken coyote
#

just google online converters. there is tons of them

viral patrol
#

I think that filesize might be way too big for online converters.

fallen horizon
#

@velvet cave still no luck finding out ? I guess its not by how long weve been waiting

velvet cave
#

i havent received any feedback no, did no-one send an answer without tagging you?

#

it could be that someone answered it while i was working or sleeping, which day did you ask again?

primal flume
#

Does anyone know if it's possible to make a widget or sumthin to display the streamtitle as a label (just like latest sub or similar)?
(repost from #general-chat )

viral patrol
#

Sure thing!

viral patrol
primal flume
#

@viral patrol thanks a bunch !!

pastel raft
#

Hi all! I'm looking to make a command to have streamelements say something, similar to the $(queryencode $(1:)) but without the + between read back. Does anyone know how to do this? Echo maybe?

mild cipher
#

So just $(1:)?

pastel raft
#

Perfect! Thank you so much @mild cipher

mild cipher
#

@fallen horizon read up on your query and I do have a project in progress which does this- using commands/chat keywords/channel points to swap scenes/toggle sources, play media popups with a bunch of extra stuff. In closed beta, no ETA yet. - https://twitter.com/MikeyHay/status/1222587904494571520

What's this? A curious new button popped up on Triggerfyre for @Twitch...? 💵

You can now link all your triggers to custom Twitch rewards! Let your viewers use channel points to activate media popups, sound effects and switch scenes and toggle sources in OBS! 🙌 https...

Likes

146

▶ Play video
pastel raft
#

Is there a way to ignore the @user? Example !give @pastel raft something. The command I've set for this is "Here you go $(user), this is from $(sender) it's $(1:)!" But because you have to @ a user, the message displayed is " here you go user, this is from sender, it's @ user something!

#

I ran into a similar issue making a !last command which calls up the last thing a user said, the issue is that if you use it to call up your own last message it just says that you said !last lol

mild cipher
#

You'll want something like Here you go $(channel $(1)), this is from $(sender), it's $(2:)!

pastel raft
#

You're amazing!

jagged nebula
broken coyote
#

Says rates will not effect extensions submitted before February 28

jagged nebula
#

curious to why FFZ and moobot + other think it will effect them then. but looks like the updated the post and delayed it now due to backlash

regal steppe
#

Hi there, I am looking into building a custom widget and I'm curious to know if widget fields etc are available outside the overlay editor? Seems a bit counter intuitive to me to have these controls hidden behind the editor, perhaps in StreamElements OBS?

upper bough
#

you can use jsfiddle to make the html and the css, and then go back to se web editor to pit it all together + js and the json file

#

if you need more info about the events and variables you can jump into the github

#

but the widget "Custom widget" come with the event list by default so you can guide from there

regal steppe
#

I mean for the streamer to interact with the fields during a stream, surely they dont have to open the editor for that?

#

I have been using the editor to develop my widget

upper bough
#

you can make your widget react to a specific command or event, but yes the config of the widget is on the web editor

regal steppe
#

Hmm ok because I was hoping to use button fields as triggers from the streamer

#

maybe it can just be chat commands

upper bough
#

yeah yogevGood

broken coyote
#

You can do buttons, but the editor would have to be open and the streamer would have to press them

reef granite
#

is there anything exposed in a custom widget that gets the current total for that event? Like checking the total follow count or total sub count when a new one comes in?

indigo flume
reef granite
#

ahhh. for some reason i was only getting a single event logged to my console before, I guess a refresh fixed that so I'm seeing all of them now. Thanks.

reef granite
#

so just to clarify, the data i'd get from onSessionUpdate for follower-total will be correct in production, but isn't when emulating a follow, right?

indigo flume
#

yes

simple cove
#

@mild cipher I was wondering, I would rather not use the widget and try to learn a little css and java. I know it’s possible, but I do not have a clue where to start

mild cipher
#

Think you might have tagged the wrong person lol. In any case you probably mean JavaScript (different to Java). w3schools can be a good jumping off point, but I highly recommend the official MDN docs, which are always kept up to date (lots of w3schools is outdated).

Starting points:
HTML: https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Getting_started

CSS: https://developer.mozilla.org/en-US/docs/Learn/CSS/First_steps/What_is_CSS

JS: https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/JavaScript_basics

Widgets are basically just mini self-contained web apps, like a webpage, but inside a frame. So as long as you know how to do the basics of HTML (structuring it), CSS (styling it) and JS (activating it), then you can make widgets.

pulsar willow
#

@upper bough Hi there! if you're not too busy, could you help me how to have several gifs for each event? I'm not too familiar with JS so i'm having troubles tryna get it to work. This is for your FunnyNotifications widget btw

upper bough
#

@pulsar willow for now its meant to have only 1 animated image as "stream mascot" or something like that (lol) and then when event happens some variation of the animated image appears or another gif.

note: wip adding sound to a celebrationImage

pulsar willow
#

oh no I know

#

I just wanted to know if you could possibly help me make another gif thing

upper bough
#

ooh you want to change the behavior ... kk

pulsar willow
#

yee

#

you don't have to do it if its too much trouble though >.<

upper bough
#

you are the 2nd person to give me any feedback i willing to do it if its gonna help anyone 😁

pulsar willow
#

i think its really cool for what its worth, I couldn't find anything that remotely resembled it yet

#

if you'd like, in exchange for helping me I could make basic pixel animations for you if you'd like

upper bough
#

You make my day!! give me a couple of hours and ill do it... you dont have to give me anything in exchange but my DMs are open LULW

pulsar willow
#

sure np! its all I could do to thank you for helping me

lusty pivot
native trellis
#

did you change your name?

lusty pivot
#

i did it like 2 years go sadKEK

native trellis
#

ah 😛

#

and it worked fine before?

lusty pivot
#

probably, i wasn't using streamelements in the past tho

native trellis
#

ah i see

#

let me ask around for you then

lusty pivot
#

thank you ruben FeelsGoodMan

last goblet
viral patrol
#

I would add ^(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])

last goblet
#

I tried something like that this morning

#

\u isn't used for unicode in re2 syntax i think

viral patrol
sick plaza
#

hi all i look for help with a Regular expression Band phrase for Wanna become famous?

fossil tide
#

Is there a way to have a custom CSS and add another video for alerts?

shell tree
#

So youre wanting it to randomly or cycle through videos for alerts?

fossil tide
#

So I have a custom CSS for like how it should look. In SE editor I can change the sound alert but when I put something in the video alert, the video doesn't play

broken coyote
#

Are you using the default alerts and just edited the css?

shell tree
#

Ahh, theres the nerd weve all learned to love and adore LUL

broken coyote
fossil tide
#

Using alerts that I received in a package from NerdorDie @broken coyote When I try adding a video the video doesn't work. Adding a sound just works fine

broken coyote
#

What package?

#

Focus?

fossil tide
#

Borderline

broken coyote
#

So is this something custom you’ve added? Because that package doesn’t support videos

fossil tide
#

Yes I wanted to add It custom

#

But the package doesn't support video?

broken coyote
#

Nope

fossil tide
#

Oh okay, and if I make a variation, turn off custom CSS, it works. But how do i make the video smaller without having to downscale my full alert box?

broken coyote
#

Are you putting the video in SE’s image/video box?

fossil tide
#

video box

broken coyote
#

I’m about to put the kids to bed. I’ll get you your answer when I’m done

fossil tide
#

ok ty @broken coyote

last goblet
#

🤪

broken coyote
#
<div id="videoHolder">
    <div id="imgBg" class="bg"></div>
    <video id="video" playsinline autoplay><source id="alertImg" src="{{video}}" type="video/webm"></video>
  </div>
#
#videoHolder {
  display: inline-block;
  overflow: hidden;
  position: absolute;
  top: 15%;
  left: 35%;
}

#videoHolder video {
  max-width: 500px;
  max-height: 500px;
  vertical-align: bottom;
}
#

@fossil tide

lusty portal
#

I think there is some kind of filtering on the username going on. When I send in a username of "nickalass", I get sent "nickal***"

#

When it alerts, I also get this happening..

#

Is there some setting that I'm not aware of to turn off moderation to the alerts?

hardy walrus
#

If someone on desktop isn't faster I can get what you're looking for.

#

Wait is this for chat notifications?

eager ginkgo
#

Is it chat notifications and alerts?

lusty portal
#

Yes

#

Wait..

#

I don't use chat notifications..

#

Just alerts.

#

Would the bot change the alert?

eager ginkgo
#

Check the alert settings for a profanity filter

lusty portal
#

It's the default one. I see no such setting.

eager ginkgo
#

Is it only tip alerts?

lusty portal
eager ginkgo
#

Do you have that setting checked in your tipping settings?

#

I’m wondering if it’s being applied to alerts

#

If it’s enabled can you disable it and test?

lusty portal
#

That was it.

#

It works now.. Thank you.

eager ginkgo
#

No freaking way

#

That’s interesting af

lusty portal
#

Yup. Apparently, tip settings moderate all your alerts.

eager ginkgo
#

Crazy!

#

Good to know!

lusty portal
#

Indeed.

lunar wraith
#

Not sure if this is the right chat. Can someone tell me the right place to ask about alert emulations not playing in browser or in obs? Thanks in advance

carmine atlas
#

@lunar wraith if you're talking about the alert testing in the SE Overlay editor, next to the button for tests there is a checkbox

lunar wraith
#

Thanks for the reply @carmine atlas - I am aware of the checkmark and have attempted to uncheck and recheck, as well re-establishing my twitch connection and reseting the session data without avail - SOLVED

carmine atlas
hardy walrus
#

@carmine atlas Asking in multiple channels doesn't help. Only reason I haven't answered is because I don't know.

carmine atlas
#

@hardy walrus i would prefer that answer to no answer

keen ivy
#

Hello,
I'm having troubles with adding items to store. I'm sending required parameters (name, description) to the endpoint and I'm still getting error, that these two parameters are not set.

pseudo siren
#

@keen ivy Hi, Can you share what you send?

keen ivy
#

in the current code, I was just posting array, encoded to json, but I remember I was trying it once, and it was working, when I tried it today, it didn't work and throwed the same error https://puu.sh/F8Mna/09dd6ce188.png

#

this is the error

viral patrol
#

You should json_encode this array and send it as post body (not post fields).

keen ivy
#

yes, I have it encoded to json and sent as body

viral patrol
#

What endpoint are you using?

keen ivy
#

store/channel/items with POST request

viral patrol
#

Body for that endpoint is bit more complex from what I see

#
{
    "enabled": true,
    "featured": false,
    "name": "Test item",
    "description": "Test description",
    "type": "perk",
    "accessLevel": 100,
    "cost": 1,
    "cooldown": {
        "user": 10,
        "global": 0
    },
    "quantity": {
        "total": -1
    },
    "alert": {
        "enabled": true,
        "graphics": {
            "duration": 8
        },
        "audio": {
            "volume": 0.5,
            "src": null
        }
    },
    "bot": {
        "enabled": true,
        "identifier": "TestItem"
    },
    "userInput": [],
    "accessCodes": {
        "keys": [],
        "mode": "multi"
    }
}
keen ivy
#

yeeah, that might be the problem 😄

#

I was confused by the error message

viral patrol
#

Also it might be helpful for you:

keen ivy
#

nice

#

thanks 😄

viral patrol
#

There's no storeAddItem function, but you can add it easily

keen ivy
#

yeah, I'll do it 😄

#

thanks for that again, have a good day 😄

viral patrol
#

And composer.json contents:

{
    "require": {
        "guzzlehttp/guzzle":"^6.0",
        "league/oauth2-client": "^2.4"
    }
}
#

This one should work

fossil tide
#

tysm @broken coyote

keen ivy
#

@viral patrol I might have another problem, I added the function and it works, items are adding to the store, but there is problem, where I can see the item in API calls but I can't find them in dashboard

#

I copied the structure of existing items, so I know, how to add working item, but they are not showing up

viral patrol
#

It will be in response or in GET /store/channel/items

keen ivy
#

yeah, I can get them this way, but what do I need to change/add so they are showing up in store?

#

@viral patrol found it

#

I forgot to add

"sources": [
   "website"
]
lusty pivot
viral patrol
#

@lusty pivot what is your previous username on twitch? This happens when you change nickname ( https://stats.streamelements.com/c/YourPreviousNickname should be working in that case). We can merge that, but we need your previous username.

lusty pivot
#

@viral patrol it might be alikhalilifar, but i'm not sure PepeHands

viral patrol
#

I have forwarded it. For next issues, please use helpdesk-twitch as this channel is for coding/API related things helpdesk

viral patrol
#

@lusty pivot fixed

lusty pivot
#

youre my hero Feelssad

pine marten
#

is there anyway to call the twitch api to list everyone thats hosting you

viral patrol
pine marten
#

@viral patrol i just want to display in the chat cause i streaming directly from xbox and ps4

viral patrol
#

@pine marten Create a command with response ${customapi.https://decapi.me/twitch/hosts/${channel}?implode=1}

pine marten
#

okay so here its customapi

#

@viral patrol thank you very much, my stream is now 100% SE

pearl stirrup
#

I have a question why am I not looking SE.pay?

rugged rapids
vital sedge
#

Maybe a stupid question but where can I find a commandId? 😅

pseudo siren
unborn jetty
#

Is a StreamElements discord bot coming soon?

pseudo siren
#

Only planned

high dust
#

I see that Stream Elements records the activity of users including their profile picture, does anyone know the CSS code needed to show that pic in the alerts?

viral patrol
coarse crown
#

Is there an API for media requests (videos linked to from a donation)? I'd like the ability to show/hide the on stream video but keep the media playing

lusty portal
#

Any idea why gift subs are showing up at "undefined" when I use event.user and event.amount?

daring patrol
indigo flume
#

@lusty portal I would suggest to use console.log() in order to see what type of event you are receiving

#

@daring patrol The value of the counter can only be set via a chat command and variable

#

chat command is !editcoun <counter variable name here> <number>

#

Variable should be ${count <amount>}

#

The api you linked is mainly used by the overlay to get said counter value from the bot

daring patrol
#

Yeah, i know the chat command, its kinda annoying to have that written in the chat all the time i update a counter. Is there a reason why its not suppoted by the api?

indigo flume
#

and show it on the overlay via the default widget

viral patrol
#

@daring patrol I think that update event might be dispatched via websockets, but I am not 100% sure

#

Ohh. I am bad at reading today.

daring patrol
#

I can see SE_API.counters.get('counterName').then(counter => { // counter is of the format { counter, value } }); in the Websocket Documentation. is there also a SE_API.counters.set() function available?

indigo flume
#

I don't see anywhere in the websocket connection guide any mention of SE_API ASpikaThonk

daring patrol
#

mmh, is there any way to request counter updates via API somewhere?

#

Ideas Channel maybe?

viral patrol
#

I think you can check value of GET https://api.streamelements.com/kappa/v2/bot/:channelId/counters/:counterName every second, besides of that... Let me check

daring patrol
#

I already do the GET request, i need to POST an update to the Value

viral patrol
#

But you were asking about counter updates. I thought you wanted to get ping when value got updated

daring patrol
#

No i want to update the counter without having to type chat commands

viral patrol
#

And about POST/PUT methods - they are not allowed on /:counterName nor on /:counterName/:value

daring patrol
#

Thats what i am requesting, i need a POST/PUT for Counters in the API, because i am updating a lot and it looks bad in the chat

viral patrol
#

It gives 404 error instead of 405, but error message states that method is not allowed.

daring patrol
#

Yes, i know that ...

viral patrol
#

Yup. Unfortunately it seems like counter is read-only via REST API.

daring patrol
#

Yes, i know that as well, that's why i am asking, how can i request an API change to get that POST/PUT function implemented, for future use.

#

Its read only, and thats causing problems in my implementation with my bot. Right now i have to write all counter updates in the chat, which looks bad in my very personal oppinion.

#

Maybe i just switch to SE_API.store.set('keyName', obj); // stores an object into our database under this keyName (multiple widgets using the same keyName will share the same data). It can be used in the same manner if iam correct and that would be just enough. These Values can be used in Overlay Widgets as well right?

#

Or does that work only within the Overlay Editor?

indigo flume
#

Its for custom widgets

#

to store data and be reused

daring patrol
#

Ok than i have to skip that one ... Where can i request API functions to be implemented?

high swallowBOT
#

@daring patrol 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.

daring patrol
#

Thank you very much

sharp juniper
#

Is it possible to have one widget show either the most recent donation or the most recent superchat depending on which came last instead of having two different widgets?

viral patrol
#

Sure thing, The easiest way to do so is add eventlist instead of label. Enable tip/superchat only and limit displayed events to 1.

sharp juniper
#

@viral patrol Thanks, that could work. Are there more adjustable ways so I can have the amount directly after the name instead of always at the same position and remove the words 'SUPER CHAT' for superchats?

nocturne gust
#

Are there any general documentation or tips for people getting started with making custom widgets?

viral patrol
nocturne gust
#

Excellent, Thanks!

simple cove
#

I have a bizarre question, but I am looking at using some custom css for alerts, but I am a little lost. I have enabled custom css and I look at the code and I can get that, but I am unsure of where to start. I would be enterally grateful, if even someone could point me in the direction of changing one alert to my ideas and then I can go from there.

broken coyote
#

What is your ideas

simple cove
#

I want to be able to program my own alert, using a picture / video that I created, say for new follower, that pulls the correct information

indigo flume
#

Alerts handle the backend(like the variations) for you, so you only need to style your alert with CSS

#

@simple cove

simple cove
#

@indigo flume ah, I see. Can you control everything through that? For example, how the text leaves? Or the padding/alignment and more?