#dev-chat
1 messages · Page 48 of 1
I don't see that under emulate.
Uhh, I'm unsure.
Commands in chat trigger scene transitions when the overlay is being edited in the browser, otherwise nothing happens.
I'm just using slightly-customized overlays I found somewhere else so I'm not super knowledgeable
I found what you're talking about. The checkbox is enabled for both overlays
I meant this box, but your problem sounds a little bit too specific for that
do you get any errors in the console?
Yup, that's checked
How can I see if there are errors in the console, if the problem only occurs when it's not open in a browser?
you can debug BrowserSources in OBS, but with limited knowledge that is probably not a good idea 😄
It's not using a source, it's using a custom tool thing called OBSWebSocket
(I don't know anything about OBS, I'm just a developer helping my streamer girlfriend out lol)
so you capture it as a window?
I don't know.
https://github.com/Palakis/obs-websocket
I'm using this thingy.
It creates a new button under "tools".
okay and you access it via SE overlays?
but you have not set a browser source to include that overlay?
okay, then that can't work 😄
how should the overlay connect if it is not being "executed"
Welp that is a simple fix.
Thanks a bunch! I figured it'd be a stupid problem like this.
Yeah I was wondering where the heck this JS was being executed
if you need the overlay across multiple scenes, make sure to copy it as reference
so you only have 1 instance and not multiple
(On my discord now) thanks a ton Reboot. It's all working perfectly now.
also always use a password for socket connections 😄
Thank you, It was a problem with docs. In docs, it was User11 in body params but I had to write user. https://docs.streamelements.com/reference/tips#tipsbychannelpost
how do I go about getting a debug message from a widget's code, if that's possible?
oh.
i got it to work
lol.
console.log(myValue); to output something in the console
apparently the errors were already showing up in console
didn't realize they were
thanks!
is it intended for a new follower event to be called 8 times?
or is that just something that happens when emulating on the editor?
what listener are you using?
onEventReceived
apparently I can't just get the new followerTotal via that event?
or I might be reading it wrongly...
i tried getting session data again, same as with onWidgetLoad, but it seems that's not actually a thing you can get
would it be better to use onsessionupdate?
no, onWidgetLoad gives you the session data once, so you know the base amount of followers. In onEventReceived you then check for new followers and add them to that base
sure, but using onEventReceived incremented the number of 'followers' by 8
how do you check for the follower event in your code?
if (( type == 'follower') && (listener == 'follower-latest') ) {
aCurrent = data["follower-total"]["count"];
}
well it's not data anymore
it was aCurrent +1;
i'm just currently trying onSessionUpdate is all
onSessionUpdate has no listeners
window.addEventListener('onSessionUpdate', function (obj) {
const data = obj.detail.session;
$("#top-donator").text(data["tip-session-top-donator"]["name"]+" - "+data["tip-session-top-donator"]["amount"]);
$("#top-cheerer").text(data["cheer-session-top-donator"]["name"]+" - " +data["cheer-session-top-donator"]["amount"]);
});
So you can grab data["follower-PERIOD"]["count"]
Like follower-session, follower-week, month and total
ahh...
it seems like it's also emulating fake follower-totals in the Emulate functionality
let data = obj.detail.session;
const listener = obj.detail.listener;
const event = obj["detail"]["event"];
if (( type == 'follower') ) {
aCurrent = data["follower-total"]["count"];
}
else if (( type == 'subscriber')) {
aCurrent = data["subscriber-total"]["count"];
}
else {
aCurrent = data["follower-total"]["count"];
}
// Donation bar
reloadGoal();
}); ```
oops
didn't mean to be a reply
but this is currently how i'm doing it
oh didn't need listener anymore
oop
window.addEventListener('onSessionUpdate', function (obj) {
let data = obj.detail.session;
aCurrent = data[`${type}-total`]["count"];
// Donation bar
reloadGoal();
});
Wait...
didn't need event either
there is one aCurrent for all events?
nah
as I see follower/subscriber
i'm using 'type' as a way of determining if this particular widget is tracking followers or subscribers
Oh
Updated the code above
You can even do:
aCurrent = data[`${type}-${period}`]["count"];
ooo
if I decided to add a period field yeah
very cool
the way emulate works is that it has its own data yeah?
meaning it actually updates to the actual counts instead of these random follower-total (for example) when actually having new followers/subs?
woo~
wait is there a way of doing enums here?
where instead of keying in a valid text i can make it a dropdown?
for the fields?
dropdown*
yes
is that supposed to be relatively basic stuff? sorry if so
type is dropdown and the options object contains the selectable options
my command of css/html/whatnot
it's at the top of the documentation
Is there any way to set a custom currency for tips?
any one else having API issue? i get a response 200 when adding tips through the donation API but nothing gets added to the tipping history
never mind i found the issue, i think 🙂
Hi guys, can someone state whether custom commands in twich chat can do branching or not? I'm thinking like giving different responses based on either the input or a random number generator.
@brisk glen You can always hit a customapi for that
That I understand, and could utilize if it were for myself. But this was for someone not as tech savvy.
Does your answer imply it's not doable in a standard custom command?
Not necessarily. It implies that I have never found a better way to do it.
If you need to process the input and give a result based on that, then no. If you only need a random answer from a list of possibilities, then yes.
I need to process the input, yes.
then you need a customapi
Thanks for the responses. It's nice to get a confirmation from others, when your unsure of any hidden features she so on.
Question: What level of permission is required to get through a 403 - "No Channel Authorization Found" on the API? Or does it vary by endpoint?
on what endpoint?
it usually means, that either your token is invalid or the header wrong
I got it working with the points api on my own twitch, but then I switch to another channel I should have access for and it errors.
So I'm thinking I don't have the right perms on that channel.
I believe tokens are always only for your own channel, despite your permissions
Ah, thanks
One more: I'm attempting SendMessage in my own channel (https://api.streamelements.com/kappa/v2/bot/channel/say) and receiving a 200 status, but no message is appearing on Twitch. Is that one depreciated or something?
I am trying to use a follower goal widget on my page. Every widget I put in has my current followers (132) but when I go to emulate a new follower, the follower number randomly changes to something different and doesn't increase per increment. I attached a photo of the most recent attempt. I tried just using the follower goal widget already in streamelements. Shouldn't it say 133 followers if I am trying to emulate a new follower and not 43? When I emulate it again it went to 45 followers and then 4.... Does anyone know why this is happening?
The emulation sends fake data so you can check behaviour of widget
ohhhhhh thank you for clarifying that for me!
@left rampart Check if your body is {message:"Your message here"}
@left rampart You can work with points api using MITM proxy jebaited.net
It allows to create scope limited tokens
so I know you can do a {streamer} to show the current streamers name, is there a way to emulate this with {game} or other metadata? Also you guys rock! Thanks for helping the code challenged 😄
@random copper This may shine some light: https://discordapp.com/channels/141203863863558144/424943321794871296/426835740530311168
you rock! thank you!
ah! I meant in the widget overlay.
scrolling through #widget-share just to be sure though.
@viral patrol so, just to be clear, I just use the jebaited token that my user generates for me in place of the SE one I have? That's awesome, I just don't want to make them go through the process until I'm sure it works.
They can create a token that will allow only points management and nothing else. With JWT you can do more
@random copper maybe this one then https://streamelements.com/dashboard/overlays/share/5e3d4f859b7bf7b57841be9b/
@viral patrol if I could buy you a beer I would. thank you!
@viral patrol Sorry, just got back to your message re: say endpoint. After putzing around in Postman, I can confirm that it still doesn't work. I tried what you sent exactly and also JSON format.
You can also check jebaited for that too with encoded message, this one will use GET method
But direct API call - checking it
With PHP I have:
public function botSay($message)
{
if (!$this->botInfo) $this->botInit();
if (!$this->botInfo['joined']) return false;
if ($this->botInfo['muted']) return false;
$url = 'bot/' . $this->channelId . '/say';
$params = array('message' => $message);
$res = $this->sendRequest('POST', $url, $params);
return $res;
}
So basically method POST, body content type application/json and payload {"message":"User message"}
I don't suppose you'd want to share that botInit(). I happen to also be building for PHP
Maybe this 😉
It uses Guzzle
Botinit is just a function that fetches status of bot - if it is on channel and/or muted.
@left rampart ⤴️
I... think you just saved me about an hour+ @viral patrol. Let me see if this works in my use case
But I appreciate it either way
Works. Not sure why it fails in postman
There is any Channel Points Redeem event for custom widgets?
Yes there is
I can't find any examples. If someone do not mind linking to me. The github obj.detail.listener list do not say anything about it
Well, there is no specific event for channel points (yet), but you can listen for messages and check the obj.detail.event.data.tags["custom-reward-id"] property. You just have to find out the id for the redemption and then you can check for it
Oh I got it. I'll test it later. thanks for the info
it has to have a message attached to it. otherwise its not going to trigger a event
Hi, is there new alternative for this? https://api.streamelements.com/kappa/v2/speech?voice=Brian&text=dsa
I think you may use AWS for that - Amazon Polly offers TTS. Free tier is limited to 5megabytes of text per month, so it should be more than enough.
there is also https://responsivevoice.org but you can't use that for commercial projects
AFAIK streaming could qualify as commercial in most cases.
Hey! Love the new widget for the instagram! Looks really cool! does it also work for Videos on Instagram or just pictures?
oh my redeemptions has no message.
Hello, so, i made this custom event alert but i don't get to make it work in streamelements the way it works is that when we call a JS function with different infos as arguments it will show the alert
does anyone know how i can make that work?
Custom widget or Custom CSS for an alertbox?
for an alertbox
you dont need to call anything for an alertbox
whatever js there is, it will be run whenever there is an alert so, for example the alert() will be called when there is an alert
hello can i ask smthk i nead to add overlays from stream element to the obs how can i do this
i am new and i dont know how
so, if i put like:
followAlert({{name}});
at the end of the code it will work?
There is a link icon in the top right, click that it will copy a link to your clipboard, add a browser source in OBS and paste that link
it should, but why make a function and then call it at the end when you can just have the JS
because there are multiple functions xd
from where?
can I see the JS
To add your overlays to OBS, add a new browser source in your scene. Paste your overlay URL in the browser source properties, set the dimensions to 1920x1080 (unless you changed them on the website) and check Shutdown source when not visible. https://youtu.be/KDvLynUqXI4
1sec I dm you a zip file
We have a command, wow
nice!
did something changed with one of the session "amount" fields for cheers, tips or stuff?
got a endcredits scene and i am pretty sure it worked before. But yesterday it didnt. and when looking in the console i see a "VM5733 about:srcdoc:185 Uncaught TypeError: Cannot read property 'amount' of undefined" Error
session['cheer-session']['amount']
session['tip-session']['amount']
and event.amount
are the only "amount" places i thinks i am trying to get a amount 
This error will happen if you load overlay and you have no event of such type during that session.
You should check if typeof session['cheer-session'] !== "undefined"
Can someone help me resolve an Account issue with my Streamelements? I have two separate accounts for YT and Twitch (this was accidental and I've only used Twitch up until this point) and I'd like to merge the two. I'm trying to close my YT account since it says that it's already claimed when I try to add it to my Twitch account, but I've been unable to close it for some reason. Keeps telling me my email is invalid
Sorry I posted this in two places, didn't know which would be best
Heyho i'm using streamelements now for a couple days and was wondering if it is possible to have multiple goal bars rotate? like showing followers for a couple seconds then subs then dono. anybody got an idea for that?
I have one. It’s in #widget-share
yeah i found yours and looked at it but that's not it. cause i want the goals to be rotating by itself and not show all at the same time
is the V2 API not fully implemented? I can get valid responses for most GET requests, but whenever I try to list current user redemptions I get a 401 unauthorized error, looking at the docs https://docs.streamelements.com/reference/redemptions#get-my-store-redemptions-by-channel-id the only response listed is the 404, does that mean this feature has not been implemented?
nvm, I figured it out... beats head against desk
thanks! Throws no error now, will see if it works next time then
Hello,
I'm sorry for my late response! @viral patrol
So okay, what do I do with what you sent me?
I'm talking about this:
@warm needle There's easier way for that, you can grab "Ultimate text widget" from widget-share channel and set text to {tip-latest.name} {tip-latest.amount}€
And I could have an animated color?
That's what I wish @viral patrol
Hmmm. You will need to play with CSS/JS then to achieve that
Like using GSAP for color change
It looks complicated, I don't know anything about it. 😁
I'm thinking about giving up, I imagined it would be easier to have an animated color for the last donation for example
You can add something like that to CSS:
* {
animation: color-change infinite;
animation-duration: 2s;
}
@keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
There is the widget with neon animation: https://streamelements.com/dashboard/overlays/share/5fb4e2b06a2776542d809f66
Ooh nice!
So already, which css are we talking about?
But I have the impression that there is no need to change the css with this widget if?
And for the widget, I would like the all time donator, I didn't succeed by putting "All time top tipper: {name} - {currency}{amount}". :/
Hello, is there a service that allows me to create clips on YouTube? Neatclip seems dead and I am looking for a alternative
@warm needle You can use data templates like here: https://github.com/StreamElements/widgets/blob/master/CustomCode.md#common, just in form like {follower-latest.name} instead of data["follower-latest"]["name"]
it doesn't work. It just copies what I write!
data{tip-alltime-top-donation}
{tip-alltime-top-donation}
I would just like the nickname of the person: the amount (all time donators)
{tip-alltime-top-donation.name}
There is just the nickname that is displayed
Right...
{tip-alltime-top-donation.name} :{tip-alltime-top-donation.amount}€
So just use two phrases
As on docs
I used both sentences, it works but the amount is incorrect! It's missing 1 digit and there's a huge difference in difference hmm
It may miss something in decimal (like display 12.4 instead of 12.40), but in that case I suggest using toLocaleString method
@viral patrol toLocaleString ? What is it ?
heu
I don't really understand, is it something I have to add in the widget? I don't really see
What exactly do I have to paste to get the nickname and the total amount of the person please ?
{tip-alltime-top-donation.name}: {tip-alltime-top-donation.amount}€ - this, but if you want amount in other format it requires changes in JS code
Yes because it's the wrong amount
Is it just a missing "0"? in decimals?
Yes it shows me a two-digit number and there are 3 of them
I think it should be something like:
let prepareField = (field) => {
const locale="en-US";
const currency="EUR";
if (typeof field === "undefined") return;
if (typeof field.data("template") === "undefined") {
field.data("template", field.html());
}
field.html(field.data('template').replace(/{([\w\.\-]*)}/g, function (m, key) {
key = key.split(".");
if (key[0]==="image"){
const index=parseInt(key[1])-1;
if (typeof fieldData['images'][index] !=="undefined") return `<img src="${fieldData['images'][index]}" class="image"/>`
}
if (!sessionData.hasOwnProperty(key[0])) return key.join(".");
let data = sessionData[key[0]]
if (!data.hasOwnProperty(key[1])) return key.join(".");
if (key[0].indexOf("tip")) return data[key[1]].toLocaleString(locale,{ style: 'currency', currency: currency, minimumFractionDigits: 3, maximumFractionDigits: 3 })
return data[key[1]];
}));
//field.html(splitLetters(field.text()));
}
Where you define locale/currency to your need
But wait... You pasted me a screenshot with 10€
EUR doesn't have 3 fraction digits
It shows me 95€ and the total amount is 620
The 10€ was the last donation, not the total
I have copied and replaced all the JS !
Oh... You want TOTAL top, not the single top tip
{tip-alltime-top-donator.name}: {tip-alltime-top-donator.amount}€
Yes total of all time! I'm sorry, I thought we understood each other, I should have been more precise in what I said.
Ahhhhh
It's working
Oh ok
Just put donator instead of donation !
Great anyway, it works!
Is there just the pulse at the moment or is there another style?
It's already good, I like this widget!
You can use any CSS animations, but it requires coding knowledge
Which is not my case ahah!
I'm going to try some stuff to see if it changes !
Anyway thank you and sorry again 🙏
Hey everyone 👋🏻
I have a chat widget that basically listens for new events and if that event is a message, it displays it. My question is, is there a better way to do it, or is that it? Also is there a way to make it listen to another streamer's chat? For testing purposes
Thanks in advance
Is there a list of fields that I can create in the json part of the custom widget?
I haven't been able to find documentation for the fields.
Hi,
I'm trying to add a cool down feature to the "video on command"-widget (by benno).
I've thought that something like the following would do the trick .... unfortunately the command doesn't response anymore after one execution.
// added variables to log the time of the last successful execution.
window.last_successful_command1_epoch = Date.now();
...
window.addEventListener('onEventReceived', function (obj) {
...
let now = Date.now();
if (message == userOptions['command1']) {
// added evaluation of cool down and logging of last execution time.
// 'cooldown1' is a slider that allows the user to specify the cool down time in seconds.
if (now - window.last_successful_command1_epoch > {cooldown1}*1000) {
video[0].load();
source.attr('src', '{{video1}}');
video[0].volume = {volumevid1}/100;
play();
window.last_successful_command1_epoch = Date.now();
};
} ... ```
the *cooldown1* slider looks like this:
```"cooldown1": {
"type": "slider",
"label": "Cool down seconds for command1: ",
"min": 5,
"max":6000,
"value":60
} ```
The idea is to store the last successful execution time, substract that from the current time and compare this to the specified cool down time (in milliseconds).
Unfortunately I've never coded in JavaScript and I'm totally new to StreamElements-widget-modification as well ... so I assume that the problem is the storing of the last execution time? 😅
If that's the case, how am I supposed to store data for "persistent" access? 🤔
Every impulse is highly appreciated.
Have a good one!
you are kind of close; i think... but not using the correct approach.
short version:
a) set-up a 'onCooldown variable' that is true/false
b) check if "onCooldown" before running
c) if not on coolDown then run
d) set coolDown to true
e) toggle coolDown to false with a setTimeout()
f) hard mode; add a queue system that adds the event into a queue that checks after the timer 😉
Hi there guys, I'm looking to create a widget for my stream and was looking for some feedback on it. I'm a full time developer frontend/backend. My goal is to create a widget that works with postmates (I'm already accepted as a partner with them), in which people can donate to streams and have food delivered to them with locations they have determined beforehand. The donation would cover all fee's and tip etc..., and the widget simply shows progress of the food being delivered and handles payment. First, has this been done before, if not, is there any legal issues with me creating a widget of this type? Is this okay to do?
If this is okay how would I go about creating a really simple progress bar type display widget as a practice run? (Thanks in advance for your precious time in responding!)
Quick off the top of my head answers; yes something similar exists (treatstream.com and probably others); legally, i see no issue (not a lawyer) but you'd just just create a middleman app. only issue would be for the purchase amount and streamer would need to include that in their taxes. I'd guess you'd have to supply the streamer with total amount of good received(?).
Good to know there is at least one company trying the concept.
To create a simple progress bar; honestly; just use your normal set up or anything really (i use codepen)
ya ya; that was my next point. just because it exists; doesn't mean you can't make it better 🙂
Can you give me an example if you don't mind? Or link to one?
Yeah, I'm not to worried if they exists since I plan to do it a little differently then how they do.
It's all about marketing anyways for ideas :).
It appears they don't work with postmates but do their own solution, I'll have to see how they do that.
I'm just extremely new to creating widgets but not programming in general.
I wasn't sure if they had a simple widget making tutorial page somewhere.
yup; here is a basic codepen https://codepen.io/pjonp/pen/qBbQrRr
it's basically HTML/CSS/JS
Once I create the HTML/CSS/JS, how do I create a widget from it?
Is there like a place I have to go to register a widget?
You make it the HTML/CSS/JS/JSON on the website editor.
then if you want to share it; you submit the data to the the pinned link.
if you want it an 'official' widget on the website; that would be a staff or lx question
I'm logged into stream elements right now, where is it located in there?
alright good to know for later 🙂
Do I create a new blank overlay then add widget->custom?
yup yup
I see it now then 'open editor' to get to the code.
ya. that is the hardest part. then getting it into OBS
Yeah OBS would use it as a browser source by linking to the overlay
Which reminds me, OBS has a horrible memory leak bug with stream elements right now which is unfortunate.
at least on the mac side anyways
Not sure if you knew about that issue.
it's only with stream elements browser sources for some reason.
The only workaround is to hide it in OBS and the make it visible again to clear memory
are you on Mac with OBS.live? i think they'd love to know any feedback with that
i wanna say that is #beta_selive ? but i don't touch OBS
... hahahah which is why i say that is the hard part (for me)
ah I see, is OBS different from OBS live?
.Live is a plugin
ah I see, I have not tried the plugin yet.
I'll have to see if that plugin works on the mac side.
so it adds... oh your a Dev; ... it's a plugiin
adds the SE options like bot naming and redemptions
Is there any restrictions for the code in the widgets accessing external sources?
since it could access an external website (like CORS issues etc)
since I would be accessing my server for example in the widget to do the API calls
it's in a sandbox; but should work alright.
Alright so there is no restrictions to running javascript from an external sites?
You would think there would be for security reasons hmm
Not that i have run into personally
It's possible to make nefarious widgets potentially, which is why I assumed they had some verification thing
I guess I'll have to play with it and see what issues I run into.
Ya; that was what I was about to say; if you want the app published; you can't use an external source. it'd need to be a CDN
ah okay that makes more sense.
So the widgets since they are assumed to be run locally I guess that is what you meant by sandboxed
but a published widget would be different hmm
All I would need to do is ping an API to get the results of the delivery and update the progress bar
so that would technically use AJAX to do that.
You know any workarounds for that? (and thank you again so much for your help, I really do appreciate it)
I wonder if they could make exceptions for certain javascript to be allowed to be run (or certain approved sites).
- Widgets are sandboxed. So you can't have 2 of them on the same layout to talk with each other
Oh I see, so you are saying their javascript variables are independent
So I can't access a value from a widget in another basically
Widgets are in jailed iframes - there's no access to parent element of iframe, cookies, innodb
I see, makes sense.
You can exchange data using proxy service
- correct; but you should not be sending a ping; the API would in therory send the info to the widget; if you do a 0 second For loop ... no benuo
^ lx is the widget gate keeper.
I see, so maybe I can create something on my server that pings the API and the widget simply access's my server.
And about calling external resources - iframes have no origin, so you need to have "Access-Control-Allow-Origin" header set to "*" for XHR calls
lx is the best person handling widgets! 
My Server -> Pings API for delivery status -> Widget -> Receives Page with JSON value -> widget reads JSON to display progress bar correctly
Would this work?
well I suppose I should say the widget, 'asks for the value from my server'. If thats possible
It is either:
Widget <-Websocket-> Your server
Or
Widget -> YourServer (XHR call)
problem with widget->yourServer is CORS right? I would be rejected I think on security grounds
interesting, never heard about that technique.
This will be super easy to setup if it's possible to make that XHR call.
so when I create the widget in the editor, how do I set a header?
Header should be on your server.
oh so I have to send it from my server that they are allowed to receive it.
I see now.
So I just make it so my JSON response has the allow-all-origin header *
and streamelements won't have any issues with that then huh hmm
Yup. Either via environment (like nginx/apache directive) or via script that will handle that
If you want to see an example of widget doing something like in query above: < https://strms.net/justgiving-widgets_by_lx >
Yup. It fetches JSON data from justgiving every few seconds
perfect, that is exactly what I would be doing
thanks so much for this example.
In the editor, there is a fields section, is that for customization by the users?
That is correct
like if I want to create custom fields they can modify for the widget?
They are reflected in fieldData that is in onWidgetLoad payload
Perfect, I will probably add stuff there for customizing it
Or via templating variables
You can check documentation on github (link in channel's topic)
alright yeah I should probably read through that all
the link you are refering to for channel's topic, how do I see that?
I'm on mac discord currently
thanks that helps!
🕵️ API documentation: https://docs.streamelements.com/v2.0/reference
🕵️ API Connection Guides: https://docs.streamelements.com/docs
📄 Overlay Editor documentation https://github.com/StreamElements/widgets/blob/master/CustomCode.md
If you have a nice widget you want to share with people, fill out this form: https://strms.net/codeshare and we will get back to you 😉
Thanks for those links!
Thanks again @viral patrol , I think I got enough to start working now. Also thanks to @elfin arch
yup yup. best of luck on your journey. I look forward to your creation 🙂
It's possible to use the Pastbin file when calling for ${random.picker} (or a custom api) ? So it would pick a random "quote" from a Pastebin file, that usually is better to edit/write
probably a stupid question, but: where can i see what console.log() did write? I couldn't find a console 😅
@pulsar willow In custom widget or alertbox?
Unfortunately alertbox has console disabled (except of console.debug method)
custom widget 🤔
And custom widget should write to default console
So ctrl+shift+j in chrome to open console
thank you, that is what I was looking for! 👍 @viral patrol (thought it was a separate widget or something 🙃)
for custom commands is there something like:
if ${sender} == 'user' and ${1:} == 'user2' write x else write y ?
No if unfortunately.
hm thats sad but okay :/
i dont know if you got this already, but check the SE github https://github.com/StreamElements/widgets/blob/master/CustomCode.md#json
im having some serious issues with my browser sources disappearing, the only thing that will make them come back is restarting obs.. anyone else running into this?
do they still show in the source list, or do they disappear from that?
no, they are still there. refreshing the cache does nothing to bring them back either. but a restart of obs always seems to do the trick.. not ideal when live though haha
Do you have these two settings active on your sources? (down near the bottom)
i have the "shutdown source" option selected. but not the second.
i've solved the problem. thank you very much! 🥳
Well, I would try that @crystal spade , if that doens't work, i'd suggest taking it into #helpdesk-selive to see if anyone else has any ideas. this is not quite the right channel
im sorry, i could have sworn thats what i clicked in before typing the message. thats on me. but thanks for the help
How would one make a custom widget to show information such as current stream title or game (Twitch API things that StreamElements already has a level of access to) - is that possible to do within SE?
yes infact there's a widget in #widget-share that does current game (made by me) I could cough one up that shows current stream title as well if you want
oh, if it shows how to do current game, i could probably figure out how to modify it to title. thanks!
No problem I use the decapi api to pull that info fyi (also pardon the crazy coding just a newbie)
i was just looking for some documentation to see if there was any platform for it already.
@worldly mauve its perfect for what I'm looking for. thanks.
@hardy walrus thanks!
Wondering if anyone knows when it changed that the API doesn't run offline so things like Lumia can't test light reactions unless you're getting active alerts (like an offline follow)?
Did you try with this enabled by chance?
You can test alerts via the Emulate bell on the lower left side of the Overlay Editor. Simply go to your Dashboard > My Overlays > pencil/edit button on the overlay. Make sure the Preview LIVE on stream option is on to see the alert in OBS/XSplit** https://streamable.com/vtulg9
I did that, but Lumia still doesn't recognize it as an active event. The said they've been trying to work with SE but whatever change was made has been breaking things for weeks so there's nothing I can really do until something with the API shifts back. I used to be able to what you suggested (and re-run alerts from OBS) offline to test but that function seems to have ceased.
as far as i can tell, the streamelements API is (at least what parts I use) functional while you're offline. when you do an emulated alert in the editor, does it show up on your OBS scene/source?
It's not for our alerts.
but also, shouldn't Lumia be checking the Twitch API for events like follows/subs?
the streamelements API should only be checked for things like !redeem and donations (if you use SE for that)
if Lumia checks the twitch API for those events, then they themselves probably have it configured to ignore them while not streaming (otherwise your lights might just randomly flash or shift while not streaming because someone random followed you offline)
Is there a command like count/getcount but for text and not just numbers?
so you want users to be able to add text to a stored global? !quote might be close to what you're looking for.
actually, adding and removing quotes i think are limited to mods.
Hello guys, got a question for monthly bit aggregation. I wanted to have the aggregation set the same for both bits and donos, so I went to the Editor and changed in the Settings-Tab the aggregation to Calender Timing. I works well for donos, but bits still aggregates like it's set to Relative Timing. Am I doing something wrong?
On the other hand, in the donos widget there is an option for Number format under Text settings > Advanced-Tap, which does nothing on my end. There are still donos formatted like "4€" instead of "4,20€" regardless of my setting of the Number format to "100.000,00"
Third thing is: would it be very difficult to have the same aggregation settings for gifted subs like weekly/monthly instead of just top sub gifter "of all time"?
I'm not sure where I should be asking this, but has anyone else experienced a glitch when someone gives you full control of their SE account, when you try to edit for them, it kicks you out into a continuous loop of the homescreen? When I click dashboard, it just redirects back to the exact same page and doesn't allow me to do anything else. I tried logging out, back in, using incognito, etc. Its an issue with the Full Control system..
For this widget, I'd like to know how I could remove the : from the username, aka have it show as "HILENT" instead of "HILENT:"
It's the boxed chat by Cocahh - I know it might be quite easy, but I haven't had luck after tinkering with it for a good while
@cinder haven Please logout of StreamElements at https://streamelements.com/logout and then login again to your account (Twitch/YouTube/Facebook).
this link should log you out properly
when you roleplay as someone make sure they're not roleplaying to someone else
@stuck junco Unfortunately there is only all time. You can collect data on your own
@cinder haven Also if that user have their credentials on Twitch changed, they need to login back to SE, so access is populated across channel's editors.
@arctic topaz Open code editor, navigate to line #98
Thank you @viral patrol , will look into that. Can you tell me anything about the number format and the aggregation problem too?
So when it comes to sub gifts, we can use just all time data or collect data on our own. I am not sure when SE could add other data periods for those.
And number format - I can forward that
The aggregation problem is just with Bits, they are set to calendar timing, but aggregate like period timing.
Ach. I was focused on sub gifts aggregating
So about cheers - I think it should fix after next stream you changed the value
Or after clicking "Reset session" maybe too 😉
Thanks! I'll remove it when I get back to my computer, seriously appreciated 
Cheers, will give it a try.
@viral patrol Unfortunately, this did nothing to my Bits counting. It still calculates on base of period timing, despite the setting to calendar timing.
hey @viral patrol sorry for the ping 😅 any idea about this ^ maybe? 
No worries
In the one above you have multiple approach. 1) native for current channel 2) tmi for remote channels
😮 i will check it out. thanks!
So I created a really nice and simple follower goal widget, care if I share with you guy to give feedback (and speaking of which, how do I do that?)
It would be great to have another Code guru in our community. You can submit your works here https://strms.net/codeshare to join the Code Gurus club.
Awesome, thanks :). I will get on that right away, I might clean up the widget a bit more first then if it's a final submit
I was looking more for rough draft check first.
you could post your jsfiddle here
Oh, okay let me give that a try then and see if it works.
I'm okay if they steal it anyways
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
let me know what you think later, it's simple nice progress bar to fill up with a follower goal
with simple and clean options and code to get it all done, the idea was to be minimalist
this is a rough draft with more options to come later.
What do you mean?
Oh I was worried about that.
What do I need so new followers work?
onSessionUpdate for example
I see, so I just have to add that in so it updates in realtime then.
This is why i'm doing rough draft checks with you guys :P.
Thanks for the feedback @tribal zenith , I'd give you bits if I could.
well, you are not limited to one event
you could load the data on load and then update on...update
Yeah, makes sense, I just didn't think about that, but that explains why it only updated when I dragged the slider.
This is true, but the current widgets don't do this very well.
Like the only one I saw was a double thing for followers and was poorly written
If you have other good one's that are listed let me know.
I'm also using this as a test for a future widget to track delivery of food orders. I have to go now but I will check back, thanks again for this feedback, truly!
no problem
If I have Lumia open and I get a follow on Twitch, I do get a light alert. If I emulate a SE alert, it shows in OBS but I do not get a light reaction, which I did up until a few weeks ago it seems. StreamLabs works so you can test light reactions offline, just a major testing function that seems to not exist anymore in the StreamElements system.
Is there a way to call up the # of subs someone has gifted in a channel? like !gifted would have Streamelements say ${user} has gifted ${channel.giftsubs ${user}} subs in the channel! ? Not sure if this would be an API or if a standard command could work.
In onWidgetLoad I can do something like the following (let fieldData=obj["detail"]["fieldData"];), but I can't seem to get access to the field data in window.addEventListener('onSessionUpdate', function (obj) { ----- how do I get it from the sessionUpdate?
it just says the variable is undefined when I try something like this? const fieldData = obj.detail.fieldData; let followerGoalAmount = fieldData.followerGoal;
For OnWidgetLoad, I did something like this to get it to work, let fieldData=obj["detail"]["fieldData"]; let followerGoalAmount = fieldData.followerGoal;
That would read the value from the fields area for a variable I have called followerGoal.
The only thing I can think of currently is to save the entire fields that I get from onWidgetLoad into a global variable that I access from onSessionUpdate but the feels dirty... :(.
So I got it to work using global variable approach, here is the code (https://jsfiddle.net/gentleman_goat/maw5zt0s/)
the field inputs are here (https://pastebin.com/RShDEEgS)
Any feedback on this widget is appreciated 🙂. I don't want to submit it if there is any glaring errors you notice.
Hi All, im new here, are all widgets loaded via browser source?
widgets are just items on an overlay, which is just a webpage designed to be used as a browser source. load events should be triggered whenever your stream app first loads the page (or refreshes, if you have it set to do so automatically or do manually)
Hi, how to get the client id?
would anyone know how to animate things in CSS? im a bit clueless and would love help
whats the best place to host images for icons when making a custom widget?
Have them as an image-input field
ty
@high tusk You should initialize fieldData out of onWidgetLoad. Like:
let fieldData={};
window.addEventListener('onWidgetLoad', function (obj) {
fieldData=obj.detail.fieldData;
});
Then you should be able to read it within other functions (as since then fieldData is not a local variable for function triggered by onWidgetLoad.
okay that is what I basically wound up doing
I made fieldData a global variable basically
Oh. I just saw you sent another message
It is just me... Not reading to the end.
As I want to go through whole thread and not skip anything 😉
@Reap7z#0001
let channelId;
window.addEventListener('onWidgetLoad', function (obj) {
channelId=obj.detail.channel.id;
});
Or if you just want to find it, it is here: https://streamelements.com/dashboard/account/channels
@high tusk I got a little carried away there, but maybe this makes it easier to understand :D
https://streamelements.com/dashboard/overlays/share/5fcf6d68aacbc4419604f2b1
it's just your widget with some more options. (The more options the user has the better)
the animation is just a CSS transition
Yeah, not a bad idea.
I like your changes for sure.
I feel this will be a great addition to the follower widgets
Please ask your question in one helpdesk channel only. A support volunteer or StreamElements staff member will assist you as soon as they are available. Asking in multiple places will only result in confusion, not faster answers. Thank you for your patience.
Wait no wrong channel

How do I give you credit for helping me with the widget also?
I don't really care for credit, but I want you to at least get it.
My goal was as simple an example as possible and you did a really good job cleaning it up.
You don't have to give me credit, I already am code-guru
If you feel more comfortable using jQuery you can also include that, but I personally try to avoid that, if not really necessary
you could also add a little animation on goal complete
Oh I see, yeah you were using just getElementByID, which is probably fine enough
but it's your widget, do whatever you want 
Yeah, I'm not sure yet, what to do for that part. I will probably make a separate widget that handles goal complete
this way this widget is really easy to place in OBS or Twitch Studio
it might be easier to just include it in the if(percentage >= 100) { ... } since you already have that
The only issue with that, is when you want to 'place' where the goal reward goes it's hard to do in OBS
you have to control it via stream elements UI which can be a bit wonky sometimes
So by separating it, I feel it would become more modular
I've seen others that combine them though.
The idea being if I want to move around where the reward shows up I can do it easily in seconds on OBS
by simply moving the browser source location
widgets are sandboxed. So you would have to do the whole logic again in a separate widget
So I would have to rewrite that code unfortunately
Yeah exactly, that would be the idea.
It's not that bad though I think
You might wanna add a reset button
What would it do?
Reset the bar
Why would you want to reset a follower bar?
I guess I'm just confused how it would work
followers can't be reset, you can mess with the emulator settings for how many followers there is I suppose
Imagine you get botted....
This is strictly a follower goal only widget.
oh I see what you mean now possibly.
So you are saying set a 'start value' for the followers
So lets say I already have '50' followers, I can do an offset value or something
like... 10 offset, and now it will say I have 40 followers.
is this what you mean?
anan
essentially an offset would act as a reset I suppose of sorts
I think he meant a relative percentage instead of the current absolute
Can you give me an example if you understand what he meant?
if you currently have 50 followers and want to get to 100, you could set your goal to 50 new followers instead of 100 absolute
so you have 100 in the end, but gained 50
Also document.getElementById("progress-bar").style.width = (Math.min(percentage, 100) + "%"); can instead be max-width in CSS
Just to ease things out
what will that change? just curious how it changes its functionality @sturdy oak (max width would imply the width can never go past that amount, in my case I want the user to be able to choose any width they want, would this still work in that case?)
@tribal zenith I think I get it, so I could add a field called 'follower offset', which minuses the current followers perhaps, or wait maybe I still don't get it hmm. that is still absolute hmm. How would that input look? Like something like 'relative follower goal' maybe
you currently use follower-total. You could change that to specific timespans
You can do that?
I just assumed that is the only data they give me. Are you saying it's possible to query follower-total from certain times ranges?
If so that is pretty amazing.
Instead ofonSessionUpdate, onWidgetLoad will get follower total, and it will be incremented in onEventReceived so that resetting is possible
reset as in?
the increment of onEventReceived
@tribal zenith how would it reset?
I meant in this case
is there a widget that is a timer?
Hi! where can i find some custom donation goal bars? thank you!
@silver estuary You can check #widget-share and search for "goal" there, You should find several of them. You can also purchase one at external websites like Nerd or Die or Visuals by Impulse.
@viral patrol Thank you!
@viral patrol I´ve been searching and didn´t found anything relevant , could you please redirect me to some? Thank you!
@silver estuary Just navigate to #widget-share, press CTRL+F and input goal, so your search phrase is: in:#widget-share goal
LOL at first glance i saw ctrl+f4
Hello, I want to mess with custom widgets, I already know basic html and css, do you have any good link for somewhere to learn how to make good custom widgets?
@nova lance You can check channel's topic for documentation, grab a widget from #widget-share or github and adjust it to your needs. There are plenty of possibilities.
hey guys is there an easy way to pull label data so I can animate them in and out? instead of a hard cut like they do with normal labels?
Hello, can anyone confirm whether this is working for fetching the session subscriber count? data["subscriber-new-session"]["count"] I can't seem to get it to work. Seems like my javascript code doesn't compute whenever I add it to the code.
Maybe since I'm not live there is no session?
This is with the custom widget creation.
data["subscriber-session"]["count"] Same problem with this one.
Read and follow our server rules:
- We do not tolerate toxicity! Treat the community team, staff and all members with respect.
- No advertisement or channel promotion, anywhere on the server.
- No NSFW/NSFL
- No unsolicited DMs or friend requests to server members
Make sure to read the #welcome in any server you join.
Any example of store item redemption event for custom widget?
New update to custom widget editing:
You can now edit the underlying data behind field values directly, for debugging/cleanup/accuracy/etc
my overlays editor is not working at all, i have already disabled hardware acceleration, tested it on other browsers and nothing works, it won't open, only if you leave the overlays blank
[15:46]
I can open the editor
but only if an overlay is empty
if I put something in it like text or alerts
it doesn't open anymore
hey @viral patrol im looking at the multichat widget you made and im like SO lost 
First, I realize i need to fix up my code, that's for sure.
Second, I cant seem to be able to pin point the code that listens to the other channel. could you please show me? my brain is fried from a college project i have been doing nonstop 
@charred vortex It is client.on('message', function (channel, userstate, message) {
This one parses message from tmi and dispatches window event that is received just like native message emitted by overlay
Does anyone know how i can make an alert for merch sales from something like, Etsy? I've looked everywhere but cant seem to find any info or ideas on how to set up something like that for twitch
Etsy seems to have a realtime-API (https://www.etsy.com/developers/documentation/getting_started/real_time_feeds), but you have to ask for access to it, by mail.
Once you have access, you can poll the API every X seconds and check if anything new happened
Can you force onWidgetLoad?
why would you need that?
Well I have a checkbox that toggles between include and dont include $
The change only takes place when I reload
any changes, it automatically trigger load
hmm
^
aah
But the other checkboxes update for some reason
Sequel to my original goal bar [Still under Progress]
https://streamelements.com/dashboard/overlays/share/5fc0a0974a180c1a11b570b9
Have a look ^^
IMO..... i would do a "if tip selected, then add currency symbol" in the js
instead of a checkbox
The thing is, it is originally made to count a Tier1 Sub as $2.5 instead of 1 Sub
So the only thing that dosent need $ is followers
It was made to be a money goal tracker instead of X Subs/Bits
but it shouldn't round up I think
if 10 people donate $2.50 it displays $30 instead of 25
I can set it to how many ever decimal places, it was just a design choice. let me change that
if you want to combine that, you could hide the decimals if not necessary. So show it on $4.20 but not on $5
or more technical decide if you display an int or a float
like this let isInt = ((amount % 1) === 0);
is there any way to open the files for the css editor in my own IDE
like vscode
or do u have to edit on streamelemnts site
okay ty
so im looking at custom code for a animated alert package someone else made so ican learn myself, i see that they are using anime library in the JS but i dont see where it was imported, is stuff like anime jquery and all that already imported?
it is not auto-included, they probably have a script tag in the HTML markup
ah shit
im stupid
ur right
ive been using react so long i forgot the basics of plain html/js hdjdjdj
wait, is it a cyberpunk overlay? 😄
no sirr
its the showdown alert package from nerdordie im using it to teach myself custom alert code
i always see streamers have a nice animation to their alert but then the text looks all wonky and out of place so i wanna like animate the whole thing for them
oh okay, I released a free cyberpunk overlay yesterday, that uses anime.js and just thought "What are the chances" 
ooo id like to see what uve made
a lot of people prefer gsap over anime.js, but I think its still viable enough
i love how u can do data injection with SE makes everything animatable
i cant wait to see wat things i can make w this
yes i prefer gsap when it comes to animating scroll animations
havent used it in a hot minute tho, working on react apps dont rlly do animations except basic microinteractions for buttons and little animated svgs but we use lottie to have those just play straight from an after effects file
ahh v nice just tried a few alerts
thanks, but the timeline got pretty complicated pretty fast 
but I guess it would be even longer with gsap
whoever added the CustomLabels to the widget list in the github, are you able to add delay & transitions to them pleeeassseee 😄 😄
Hello! I'm new around here, so forgive me for posting in the wrong place, or something...
I've been trying to learn Japanese on stream, and I'd like to know if anyone would be interested in developing a Japanese dictionary widget for Twitch. If such a widget already exists, please do tell me where to find it!
I can explain what I want to those willing to do it, though. We can discuss the details via PMs, so feel free to send a message to me.
Thanks in advance!
Hello everyone! I am looking to send notifications or alerts through the apis of streamelements but I can't find the way
Hello guys, i wanted to make a loop alert and when another alert triggers, the loop changes, anyone knows how to do that??
what do you mean by "loop"?
Loop i mean that i have an animation and that animation is playing until another alert triggers
And the animation doesn't stop
the animation is a video file?
Yes
My text on my custom coded CSS alerts doesn't seem to want to stay in one spot. Sometimes it's centered, sometimes its off to the left or the right
@pale acorn then you could just create an html video tag, listen for the video ended event in JavaScript and if an stream event happened change the video src, else repeat the video
how do you center?
Im just using position: absolute and then setting its top and left locations by px
Thank You, also I want to know how i use those events in JS??, because I don't understand the documentation
yeah, I thought so. Depending on your layout, you could try the flexbox centering approach or just margin auto
you mean the StreamElements events?
Yes
you can listen for events like this:
window.addEventListener('onEventReceived', function(obj)
{
if(!obj.detail.event) return;
const listener = obj.detail.listener;
const event = obj.detail.event;
if(listener === 'subscriber-latest')
{
console.log(event);
}
});
onEventRecieved is constant?? Or i have to put something there??
that's just the name of the event, but it is constant yes. There are other events as well, like onWidgetLoad and onSessionUpdate
they are all documented here: https://github.com/StreamElements/widgets/blob/master/CustomCode.md
@tribal zenith Thank you, you helped me a lot
No problem. Just try to keep your video file sizes low to speed up the swap times and save some memory
or if they are just a few MBs maybe just changing the visibility is enough
Hello everyone! I am looking to send notifications or alerts through the apis of streamelements but I can't find the way
So TIL SE_API storage code isn't self-throttling, and runs into 429 responses then fails to save when large sub-gift batches drop in my codebase. I know how to implement throttling and debounced retries on my end but since I can't enforce synchronicity between multiple copies of my widgets (on different scenes for example), is there at least a consistent/graceful way I can detect 429 responses have occurred in-code so that if too many widgets happen to send push requests close together I can retry on a delay/use random delays to stagger them?
Hello, is there a possibility to give random user points between 1-50? I looked at "jebaited" and set it up, but after entering the command I get an OK from StreamElements in my chat
@viral patrol ^^^^
maybe this answer? :D
#helpdesk-twitch message
@split zinc Check this one: https://streamelements.helprace.com/i519-provide-an-addpoints-variable#item_comment_block_59866
This should display something else than OK AFAIK
@hard spear With data that is updated with short intervals (like on every event, which includes messages) I prefer to have separate function that sets value in store every 10 seconds instead of onEvent.
After entering it, it shows me "Ok", does it mean someone has received a random number between 1-50 points? If so, why doesn't it show who? No matter how often I activate the command, I always get an "Ok"
But debouncing is nice. Like having a function that has a timeout
Let me check that on my end
Syntax: ${customapi https://api.jebaited.net/addPoints/TOKEN_HERE/${random.chatter}/${random 0-500}}
Response OK is when you add points to every chatter, not a random one
Thanks, it works now
Heyo, wondering if someone can help me with custom commands here: I would like to have a command of the sort !addGuess <guess> that would:
- add the guess to a list of guesses if it's not already in it
- regenerate some other commands like
!guesses1,!guesses2etc that would print the list of guesses that have already been made.
Is there any way to do that natively? When I go to the command-share channel I see a lot of commands using "customapi" which I'm guessing means I would have to host an API server.
That is correct. You will need two commands: addguess which will forward ${1:} (user's guess) to your remote location and then guesses which will forward ${1:} (index/word/empty) and it will reply with 15 users thought it is XYZ, or We have 92 guesses so far
But basically - it cannot be done natively without external storage
Or maybe... You could do that as overlay widget, but it would not work when your OBS is not running
Is there any way to modify existing commands based on the API response?
Although I guess I could just have the page be an argument of the guess command
You cannot modify existing commands with ease, but you can have !guesses [parameter]
!guess 1 would call my API and it would return the first page of guesses
yeah ok
The part that sucks is that I would need storage so I can't just use a lambda function
Thanks for the help!
although I'm seeing some commands in the command-share channel that seem to use https://script.google.com/macros as a custom API, I wonder if I can do something with that
Oh yeah I can totally do that
And as I mentioned - you can use a custom widget for that purpose
One minute for a simple example
But widgets can only display stuff on the overlay right? Or can I use a widget to run custom code when a command is typed?
There is MITM proxy service that allows bot messages.
Does jebaited have any documentation?
You're talking to it. /s
Oh is lx the creator of jebaited.net?
Yup
Okay I think I got it. That's pretty nice.
Any reason I can't just POST directly to https://api.streamelements.com/kappa/v2/bot/channel/say? Does it have CORS disabled?
(from the overlay widget that is)
You can use direct call but it will require authorization with write privileges. JWT is "all-in" so in case your overlay URL leaks, somebody can get access to your token. With jebaited in the middle leaked token will allow to just send messages as bot (or other scope you are limiting it)
Hence the scoped jebaited tokens, gotcha
But I could totally do what I'm trying to do without a proxy directly from the widget
You could of course using the endpoint you mentioned.
That's really cool. Thanks a lot for the pointers 🙂
I have to add POST method on botsay, so you could just pass a JSON with {message: "text"} without having it to be encoded for GET parameter
Yeah I noticed that. What's the reaspon for this:
replace("%2F", "%252F");
after the encoding?
It is because somehow / character is not encoded properly (and it looks for the path). Replacing it fixes the problem
I was just wondering if you would like help with documentation or some such, since it seems like a cool project
Thanks a lot for the help anyways I think I've got a good foothold of how the whole widget/command ecosystem works now
I just fixed a problem with JS there
So when you click on scope, it will display you data
It is now possible to send message via POST with JSON body:
URL: https://api.jebaited.net/botMsg/:Token/
Payload: {"message":"Just message here"}
Oh that's nice
I'm still struggling to center the username in my alert using flexbox, if anyone is able to help me out with that
Add this to the parent container display:flex; justify-content:center; align-items:center; text-align:center;
When I do that it aligns to the left of the widget
you need to add it to the parent container
Would that be the .username within the CSS
The parent container would be awesome-text-container
Oh I see
I've been trying to make that work within the CSS, but that's for HTML >.>
well you gotta add the css I gave you to awesome-text-container
add this too
*{
margin:0px;
padding:0px;
box-sizing:border-box;
}
I think that did it
@viral patrol I think this should be added by default, there's no need for it
It's still a little buggy, some names go to the left or right a bit, which is just odd
Actually it might be my eyes playing tricks on me, my lower text isn't getting centered yet, which is throwing me off
I would do something like:
.awesome-text-container{
width:100%;
text-align:center;
}
See my confusion comes in with the inconsistency of it
Sometimes it's like this
But then it's like this
Try changing the span to a div
Now it always aligns to the right
we cant help you unless you post the entire css and html
True
so we know what you're working with
How are you guys embedding code directly into here?
Or would you rather a screenshot
You can use jsfiddle/pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Oh. So you changed spans to divs and since they contain text I would set their width to 100% and text-align: center
As you don't need vertical alignment
Isn't that already what its set to under the .awesome-text-container CSS?
Try to get the width of the alertbox right, because it's gonna align it to the center on the entire widget
One sec
I've changed the width to be the same as the actual alert but it still randomly aligns to the right
display:flex;
justify-content:center;
align-items:center;
text-align:center;
display:flex;
justify-content:center;
align-items:center;
text-align:center;
display:flex;
justify-content:center;
align-items:center;
text-align:center;
Hello,
I have a problem with my ''credit roll'' widget. When I show it on stream, it says between every cheer and every donation ''undefinded - undefined''.. also there are some „undefined“ subs as well.
for example:
jerry - 5€
undefined- undefined
paul - 10€
undefined - undefined
When I emulate cheers, bits and subs, everything seems fine.
Do you know why?
Thank you very much!
Alright that all seems to be good now. Thank you all so much for the help, I know it was probably super annoying. Now I just need to add a stroke to the text and I should be done 🙂
Text stroke is not always nice. This is why I usually have text-shadow to act as on
Yeah thats what I just found out lol, but I got it how I'd like it to be
Thank you again for your help earlier. It still comes in a little too much to either side randomly, but it's pretty good
It seems to be based on the length of the username that decides if it wants to be centered or not
anyone can help me with websocket api?
I'm using the example provided on docs, but i'm getting ping timeout without connecting
@devout mulch Hi. I am not fully around, but those two may help you: #dev-chat message and #dev-chat message
@viral patrol I'm using the first example, I'll try the second file
The second one basicaly is locally hosted custom widget environment written around first link, but it is a working example
ok I found the issue
apparently we need to use version 2.2.0 of socket.io
it wont work with newest version 3.x
probably it need to be docummented
or better, upgraded on server side
Any idea when there will be an API for Caffeine?
When they have one that's publicly available.
Where I can get my kvstore token, if possible. If not, how to save/get custom data?
I'm using nodejs, not from the widget editor
how do i get my hype cup on overlays to actaully pop on on my obs
I was wondering if anyone could help me make a custom command for StreamElements where I could get paladins stats displayed in chat. I tried using this site https://nonsocial.herokuapp.com/ however when I add it as a custom command I get "Internal Server error" or " Error Connecting To Remote Server"
Can someone point me to some online guides or something? I want to make a new streamelements widget. I just want to be able to call a video by command using streamelements points. So like, !command, charges user a set amount of streamelements points and the overlay loads a video that I've set with a transparent background. Can someone tell me how to do this please?
Hey yall. is there a way to make a clock that syncs 2 widgets together?
@viral patrol yeah that's the plan, I'm just wondering if I might still run into issues with 5+ widgets in total that need to do this.
based on my testing 4-5 clustered PUTs seemed to trigger 429s on the 5th or 6th.
@viral patrol oh I misspoke. Actually, rather than saving every ten seconds, I'm going to be using a cooldown promise and a pending flag. Saves are requested. On initial request the pending flag is set to true. If there is not already a pending request, then the save is scheduled on a promise chain. Each promise in the chain executes the save, sets the pending flag to false, then waits 10 seconds before resolving the promise. If a new save request comes in during that time, the pending flag is set to true and the next save is scheduled on the chain, no less than 10 seconds after the last save. If a third request comes in during that 10 second cooldown, it is a no-op, as the save is is already going to happen at the same time as would be scheduled by that third request. This mechanism allows saves to occur only on-demand, whilst also throttling the number of overall saves, so it's good for uneven events like sub-gift bombs.
Yup. That seems like a good way to go, but if you have a pending flag i wonder why would it reach limits.
Niiice .... what am i doing wrong? .... (nothing sent to chat) 🤔
Zalgo filter using jebaited token. Very limited testing; but seems to work. 🤷 ```js
const jebaitedAPIToken = 'yourTokenHere';
// https://stackoverflow.com/questions/61519041/regex-to-detect-zalgo
//regEx Filter
const re = /%CC%/g;
//
const hasZalgo = txt => re.test(encodeURIComponent(txt));
//
let timeOutDuration = 60;
window.addEventListener('onEventReceived', (obj) => {
if (obj.detail.listener === "message" && hasZalgo(obj.detail.event.data.text)) {
sayMessage(/timeout ${obj.detail.event.data.displayName} ${timeOutDuration});
};
});
const sayMessage = (message) => {
if (jebaitedAPIToken.length !== 24) return;
fetch(https://api.jebaited.net/botMsg/${jebaitedAPIToken}/,
{
method: 'post',
body: JSON.stringify({"message": message})
})
.catch(e => console.error(Error sending message to chat));
};
This make me think - should chat widget have "unzalgo.js" included and clear messages? (https://github.com/kdex/unzalgo)
Hmmm. This has also isZalgo that is not that simple regex as above
the regEx is /%CC%/g ... but tested as URIencoded ... dat's over my head
i'm not sure how often Zalgo is used ( i honestly thought Twitch auto-filtered it)
but that would be a sweet add.
It is not filtered. But I think that usermessage is a div with overflow hidden, so this stuff doesn't exceed row
And if you check Styler's channel, you will see the chatbox is the only place
...i need to test it.
🤣
and yup. add that in the chat widget 🙂 chat overlay + zalgo filter = ^
No idea anyone ? 🙂
@marsh tiger Poking at that as it looks similar to something I saw recently: That appears to be an issue with there not being certain event types during that session.
I'm going to ping @viral patrol on this since he might have a better idea as he replied to that situation in question.
Checking that rn
Hmmm. It seems all OK on my end. Can you provide me access to your account (via DM) so I could check it there?
I added a check to credit roll widget on #widget-share so you can grab a fresh copy from there as well
Does anyone know if there's a way to get StreamElements to preload images used in an alert's custom HTML? Whenever my alerts show, the image always takes a quick sec to load
The images are currently hosted on a Backblaze B2 instance, would uploading them to Streamelements work better?
Definitely would in my opinion as they're loading "locally" vs remotely.
Thanks, will try 👍
Also you can setup headers for your images, so they could be cached for longer time. Or preload them with JS before alert fires.
I actually tried preloading them with JS but it didnt seem to make a difference. Is each "alert" on an overlay sandboxed in an iframe?
It is.
my thought is preloading wouldnt do much inside the widget if the widget gets loaded on demand anyway
And that iframe is destroyed after event
Also as I mentioned - OBS caches data
So you can set your webhosting to emit headers that will allow obs to cache your static files for longer
No idea if I can do that with Backblaze but I'll look into it, thanks!
So if I'm reading that correctly the zalgo filter is only meant for Chat Overlay Widget, not as actual filter for the bot to read and delete chat messages from.
it wouldn't really work if it's just for Chat Overlay Widget, it needs to be usable for just actual Twitch Chat
@viral patrol well an individual widget won't, but multiple widgets might since they can't share the flag. It's hard to tell without even knowing the API rate limits.
Hello, was wondering is it able to make an animated border for twitch overlay, but one where 2 colors keep rotating and when a follow of sub event happens then it affects the border color, almost like shouds for example? And if it's able to be made in streamelements or must you use animated software?
does anyone know where to find documentation on the custom alert box css/html/js. i'm a front end dev but the only image i am getting now is a "dancing left shark" instead of the image i selected in the interface.
not sure what variables i have to work with
@pale shale Take a look at the channel header for the api documentation and it should be {{video}}
@rugged rapids ahhh okay got you. i'm not great with discord but ill see if i can find what i need thanks
Hello @everyone I am creating Overlay on Stream Elements, but I notice the button to "Add Stunning Alerts and Overlays" is shaded out. Not really sure why. Please Help!!
@rugged rapids got it. did some testing already thanks.
oh wow this is great
@rugged rapids thanks so much dude this is EXACTLY what i need.
stream elements is great this is so flexible.
awesome.
Hello developers. Do anyone know how can i make overlays in Adobe Animate and connect them with StreamElements??
Sorry I am new, what is my client_id and where do I get it and how do I verify myself
@viral patrol i had a problem about widget animations. all animations couldn't work. i'm trying to use latest youtube video. can you help me?
Hello, was wondering is it able to make an animated border for twitch overlay, but one where 2 colors keep rotating and when a follow of sub event happens then it affects the border color, almost like shouds for example? And if it's able to be made in streamelements or must you use animated software?
You can have webm files and change the visibility/source via code
Any idea where to start or how to approach it?
The animation I have no idea, but you can have a look at the docs for the code
https://github.com/StreamElements/widgets/blob/master/CustomCode.md
Thanks x
take a look at this @worthy dagger ; #widget-share message
i use their border for some of my stuff and it works great. just set something like that up; then trigger the color change onEvent 🙂
Thanks bro
Hi there, just wanted to have news on the status of the credentials for Touch Portal
@sage otter go to This PC > right click > Properties > Advanced system settings > Performance > Settings > Make sure the very first checkbox is ticked, then OK out and refresh the browser source or overlay editor
https://clips.twitch.tv/NurturingTemperedLEDBabyRage Morning guys, so theres this ever lying bug that seems to happen to looping video files in the Overlay where it sometimes doesnt loop and just stops. I hadn't seen it months, but got told last night that its still happening. These can obviously be avoided by just placing the overlay (in this case) within OBS itself, but obviously its a feature thats not working as intended, so thought I'd put it in here
this is what it should look like
https://clips.twitch.tv/PuzzledColdbloodedAlligatorKappaRoss only way to fix it is refreshing cache in OBS, but it can happen multiple times over a stream
ahhh; took me a while to see it; but you are talking about the border around the camera window?
yeah, its just a webm that loops
is it one of the built in widgets or a custom one?
its just the built in video widget
I've also noticed in the Editor (not in OBS) that the video tends to freeze once in a while or just plays in SUPER slow motion - again not a crazy bug, but one that happens none the less
just assumed thats a memory thing or something within the browser so never really cared for it, as long as it didn't transfer it across to the browser source within OBS
i;ve never really played with the video widget 🤣 .... didn't even know it was there.
i wonder if there is a loop max in the code? i'm just guessing
this is the video freezing bug I'm on about
this could be possible, but its just so random, I have it working fine on some overlays, and it just refuses to on others.
ya. i'm not sure. it could be anything from a failed source request to loop max
thats it just disappeared in the editor for me
i wouldn't think it is a lop max with that first video you shared (assuming the sources are off when hidden)
@elfin arch I just want the !raffle module game to play every 30 minutes
ya. i'd skip the built in stuff and just go straight to the custom code if you can @next radish
alright; let me give you some code to make for an overlay. can't test it myself; but it'll basically spam '!raffle' every 30 minutes
yeah theres absolutely no reason to custom code just for a video loop - I can just add it as a source in OBS, was mainly just to ping it here for the devs to see, or if anyone can point devs towards that bug it would be nice to be able to rely on that feature in future
ya ya. for sure. the default video should loop for infinity.
yeah like I say, it only happens to certain ones. It works fine on 80-90% of the channels I setup, but every odd one tends to do this.
makes me wonder if its a durational thing, like if the video is >30s-1min then it bugs out
if you can; set one up that you think will fail on the website and when it does post the console of it
like this:
but i honestly am not sure. to my knowledge once the overlay gets that video; it should just repeat over and over
@mellow canyon try the code above in a custom layout; you'll need a jebaited token but should work. (it is set to 3 seconds 😉 )
@elfin arch I am not sure if that will work as bot doesn't listen to itself
yup yup; i just removed it; forgot it was playing that same game
@mellow canyon ... i was wrong. the trick i was thinking would work did not for like you said 'the bot can't respond to itself'
yep will do I'm setting one up right now, that I just saw fail and seemed to reset itself as soon as I tried it 😂
i'm not really sure what to expect or how to fix it; but if you get some red error code someone can help 🙂
.... the way i understand it; once the source is loaded to the scene it should loop without any issue.
Hi, is it possible to call the api via php curl? Can someone help?
@smoky drum #dev-chat message
@viral patrol That was quick, thank you very much! Is there a sample application for this?
There is no sample app, the one above requires: "league/oauth2-client": "^2.4",
Or even simplier use GuzzleHttp\Client;
@viral patrol thanks
@viral patrol PHP professionals probably know what you mean straight away. Unfortunately, I am not so familiar with that. The plan was to integrate the ranks from the leaderboard into a website. I could still rock the Twitch API and use data within my website relatively quickly with authentication etc. but streamelements makes everything kind of totally complicated? 🤯
Is there no way to access the data simply by token and curl?
Sorry as I said, I'm a noob in Apis so I have to ask such stupid questions 😳 😄
did you check the API doc in the channel header?
you should be able to pull that; i use JS and never worked with PHP before
If we mean the same, then yes. But I'm looking for a possibility via PHP and the docs only talked about GO and Javascript
Yes, I had seen that, but due to the lack of authentication, which I had not been able to manage, and the non-existent example scripts for Curl, I was a bit helpless 🥺
ahh ya. the doc is a little (lot) lacking.
...give me a second; i'll grab the JS code i use for something. You probably need something in the header?
Yeah thank you very much for your help
GetTopPointsFromSE: (num) => {
return fetch(`https://api.streamelements.com/kappa/v2/points/${process.env.SE_ACCOUNTID}/top${num > 0 ? '?limit=' + num : ''}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.SE_JWTTOKEN}`
},
})
.then(async response => {
if (!response.ok) {
console.log(await response.json());
throw new Error();
};
return response.json();
})
.catch(error => {
console.error(`Cannot Get Top Points For ${num} Users!`)
return false;
});
},
for example; I use this code to find the top 3 (num=3) people on the points board and give them a Discord role
that Auth* in the token is probably what is what is tripping ya up. it's not well documented
Ok, first of all thank you very much! I can use the JWT token as $ {process.env.SE_JWTTOKEN} right?
Or do I have to do another authentication?
you need to use the channel JWT
You can find your JWT token on your account channels page (Show Secrets to reveal the token): https://streamelements.com/dashboard/account/channels
READ ME: This is a private security token. Do NOT share this token here or other public places, only with a StreamElements staff member in private.
${process.env.SE_ACCOUNTID} is a variable for that long ass token 🤣 .... but i have it saved in a serverside file so hopefully people can't find it 😉
Ok then I have to deal with Node.js again. I have my own bot based on Node.js, but I need the data within a website. Then I could talk to the bot from the website and have the data written to a database, which I then call up from the website. Oh man, this is going to be a mission.
Thank you very much for your support that helped me a lot! Wish you a nice Christmas time and I'll go into battle now ⚔️
you can make that call on the website..
i guess i'm questioning your middle database; that isn't needed. just make the call from the website 🙂
Unfortunately, I cannot run Node on my main server on which the website is running. So I will probably have to do it via the bot.
Unfortunately Node.js is not supported there.
ya ya; use the php
use the "curl" i think (again i have 0 knowledge of php) but add the auth into the header
Yes or I'll try the bot. It's a bit cumbersome, but it should work.
i'm all for the custom bot and Node.js hahah that's what I use
Jebaited is what's used to send messages right?
just saying you should need to make a middle man database to share between; unless you are doing something fancy. (coughs like i use to set Discord roles based on points/watch time)
ya @sturdy oak ... jebaited is lx's helper for chat messages and points
lmao
i use it for sending chats from overlay and adding points
this is my new and improved jebaited sendToChat: removed
UPDATED CODE: #dev-chat message
@elfin arch You are my hero! With your script and the header note, I was able to solve this with curl. Mega! Many Thanks! 🥳
do you have to apply for the api token?
nope. lx gives free candy
Hey Santa, need api token@viral patrol
In case someone is looking for a php curl script for this, here it is:
$id = ### Channel ID ###;
$token = ### JWT Token ###;
$curl = curl_init('https://api.streamelements.com/kappa/v2/points/'.$id.'/top');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Authorization: Bearer ' . $token
));
curl_setopt($curl, CURLOPT_TIMEOUT, 1000);
$data = curl_exec($curl);
$i = curl_getinfo($curl);
curl_close($curl);
if ($i['http_code'] == 200) {
$data = json_decode($data);
var_dump($data);
}else{
$data = json_decode($data);
var_dump($data);
}
or with limitation
$curl = curl_init('https://api.streamelements.com/kappa/v2/points/'.$id.'/top?limit=5');
^ php curl top points header help api
tried to add all the search words. .... and good work @smoky drum 🤣 half that code is unreadable to me
Haha great 😄 The code is not really well written now, too fast, but it works. Fine tuning comes now. Thank you again for your help and have a nice day! 
you as well! and post back when you get it cleaned up or if you make other curl functions 🙂
...as you've experienced the documentation is quite lacking in some areas; and searching the Discord is how i solve many problems 🙂
you should also check for ratelimits in the header
so thank you you for helping 😉
@elfin arch I can do that. No problem 👍 In fact, the doc is really humble. And Discord was my last hope, which actually worked in the end - great 👍
i agree with @tribal zenith and the limit; /top?limit=10 if that's what you mean
the sayMessage function @sturdy oak ?
yeah
I meant the x-ratelimit-remaining header 😄
you're doing something wrong 🤣
lmao
oh ya; i don't know what that means @tribal zenith, a PHP thing?
no, it's how many requests you can send before the API server blocks you
@sturdy oak that should work i just updated it with the new post to the jebaited site
@tribal zenith Ah ok didn't even know that you have to pay attention to it.
@elfin arch I have added a limit as an alternative to my script above.
your code can be replaced with 3 lines
why bother having the json formatter
@elfin arch 🤣
Php of course. This is just the first line of code extended with a ?limit=5.
post it @sturdy oak ... that was cleanest i could do
First I need to get your method working, the one that lx gave me does
is there any way to add timer message with chat command for mod?
so its like using !command add !name text
negative. the bot ignores it's own messages
i mean, can i add a timer with chat setup?
setup timer via chat maybe the better word
i don't think so? are you a mod for the channel?

got it