#dev-chat
1 messages Β· Page 37 of 1
omg your a hero π
Also add to awsome-text-container opacity:0
So it is not glitched on start
Just in case
because before animation starts it might render this text
i originally had it on percentages as I was going to set different ones at different stages but opted out
This is "percentage" too.
You can use any value between 0 and 1
Like 0.75235
(TBH I don't know what precision can it take)
ahhh ok didnt know that! Thanks so much man, glad I stayed up and caught you, would have probably ripped my head out with that tomorrow.
Awesome, with that I'm going to bed it's 4am rn π π€
I am really interested in using a custom chat command that copy and pastes timestamps for highlights into a google doc/sheet that could be given to an editor so they can quickly find and extract clips for videos. If it could post the vod title for the first time the command is used in a specific vod, that would be helpful, so you don't have to go back and also manually add the vod title, but if it posts the vod title AND timestamp everytime it could clutter things up. I think it should be possible since you can have the chatbot post the uptime and there is a custom command for a google to-do list. they just need to be combined somehow for the most part.
@charred tundra if you are about I would like to share my use case of your quote api. I have turned it into a cat facts generator. I wanted my users to be able to add facts about their own cats in my chat on the fly, and basically act just like a !quote command but with a !catfacts skin on it. Thanks to this, that is a success! So thanks!
@flint mirage I think that you could use something like that for your custom widget: https://stackoverflow.com/questions/43375231/adding-a-row-to-google-sheet-javascript
so it would be like a custom widget that's triggered by a chatbot command?
You can create a listener to bot response to a command
Like somebody types !shot
Bot replies with "adding timestamp"
And custom widget checks if username is StreamElements (or your custom bot name) and message equals to "adding timestamp"
Thanks to that it is easier to set privileges/cooldowns and other stuff via bot commands settings
I'm using the goal widget by MRBOOST but the volume of the animation when the goal is reached will not change. I don't want to earblast anybody watching the stream when it is reached. How do I fix this?
Hi, I've been trying to diagnose a problem the new OAuth2 developer API, but I unfortunately haven't gotten a response to my question from a week or so ago. I believe it was mentioned that there's a channel in here dedicated specifically to the OAuth 2 API, but I don't see it. If that's true and it requires a role permission, could someone let me know what's needed to get that? Thank you.
@static wigeon π
Hey guys! New question. Is there anyway to bypass the main Alert Duration? I want to create an infinite loop that continues until a new alert is triggered.
If you want to achieve something like that you need to create it as custom widget. Like "Event list", but displaying one last event.
thats what I thought, just checking up, thanks!
Hi, I had some questions
- Why is there no "Follow" widget in the label section for facebook?
- Refer to the SS. I think if i have to write it again..then no point writing it at the first time on the top. [Quality of Life]
for your first question, this is a known issue and is being worked on
Is there any thread where can we find out about the known issues/bug and future improvements?
I just faced another problem and not sure if that's a known issue or not!
is it only me that got the problem when i sign in to the site its get all white but when i go back to sign in page it works and as fast as i press "my dashboard" the site gets all white and i cant do anything.
I have tried to log out several times and logged in again but it dosent work. now im using google chrome and i have tried using firefox and microsoft edge dosent work either
@strong kayak Most likely something locally is blocking the connection to StreamElements. Check firewall, clear cache and cookies of chrome, try incognito mode, disbable addons.
@rugged rapids thnx ill try
@rugged rapids Iv clear Cache and cockies dosent work i tried incognito dident work and the fire wall ain blocking and removed all chrome addons
Then something different is blocking the connection.
hmm.. :/ fuk
well guess i have to use another bot... cant get streamelements to work..
@strong kayak Please logout of StreamElements at https://streamelements.com/logout and then login again to your account (Twitch/Youtube/Facebook/Mixer)
Hi, how do you add custom Events to the SE queue?
I have 3 layers in a custom widget and 2 of them with sub and host events won't overlap each other. The third one with a custom event however does
custom event as in new CustomEvent("onEventReceived" ...
@rugged rapids when i try to log in om my Phone on my home Wi-Fi it works good but not on my pc?
@strong kayak Then something on your PC is blocking the connection.
@rugged rapids thnx ill try to fix it Thnx for the help! π
nope its the network blocking it and i dont know how to fix it FeelsBadMan
Newest Google Chrome update breaks StreamElements's Overlay editor. I'm getting this message on developer console and overlay's data is not refreshing. Is there any way to bypass that?
The bar on the top shows 3 recent events that happened on stream and the bar below shows followers count and viewer count (Viewer count is provided by DecAPI which is not working due to that error as well)
@broken coyote Just had my first stream with the Ultimate Chat Widget. People love the clips I've put in and how easy they can trigger them.
However there are two issues I ran into. First of all, it is not possible to clear the video in the editor. Clicking on the X for Clear does nothing.
The other issue is, that timeouted or banned messages by mods are still shown in the chat widget. Same with deleted messages. Any idea if that is fixable?
What exact do you mean about about clearing them? If you donβt want them to trigger to can just remove the trigger. I will check on deleted messages. I donβt think it works with twitch but not 100% I know it does with mixer
I had a very strange bug. During my stream it sometimes played the standard clips although nobody triggered them. I also removed all triggers before the stream. No chat commands were used. But suddenly it played standard clips. @broken coyote
Thatβs odd. Iβve used it for around a year now and never had that happen
I have clipped that. Could it be that someone else streaming triggered that in his stream and then it also triggered in mine? π
It happened like 3 times during 7 hours stream
That's basicly the reason, why I wanted to clear the videos, because commands are already gone.
Interesting. Iβll check the clip
anyone doing custom countdown timers? Like gradient and 3D ?
Hey everybody, I was wondering how I could make a widget?
@hoary urchin check channel topic
what exactly triggers the "chat:featured" event?
Hi guys. I need something positioning correctly. I have a rotating widget but i need the icon to be in the same spot every time. But it moves depending ont he length of the name. Is there anyone who could help?
that is more of an HTML/CS question, If you always need it to be in the same spot, you could add it through JS, using fixed position
How can I set up the stream boss so that there is a max health that it can't go over? Anyone have any API help for the issue?
anyone know how to fix so network aint blocking streamelements.com?
Talk to your network admin.
okey
is there anyway to not trigger main alerts when a gifted sub triggers?
i.e I have someone that gifts 5 subs, on the main overlay it triggers a sub alert for every single person
use variations in the alertbox.
wdym? What sort of variations?
In your alert box, in your events, there is a tab for variations.
I understand, but what settings would I need so it doesnt trigger every single subs whenever somebody gifts anything
Ok so for example. Here I have 2 overlays. Reactive Overlay & Gifted Overlay.
Reactive overlay triggers during any subs with variations set to how ever many months they have subbed.
Gifted triggers when there is a gifted sub of 1+
How can I get it so that when someone gifts subs, that it doesnt stockpile all the new subs onto the reactive overlay?
because if someone gifts him 100+ subs thats going to get suppper annoying π as it has sound attached to it
who made those graphics? asking for a friend
we make em at getrektlabs.com π π
oh i've heard from you
any idea with my problem? i.e how can I stop gifted subs triggering sub alerts
there should be a community gift sub alert which just plays one time for all x amount of gifted subs
i was just looking for it π
its set like that already though?
π€ yes that seems to be in order
hmm, i wonder if its because its on different overlays... I have it separate so he can adjust and move the main overlay around in obs without affecting the size of the full screen gifted alert
i'm going to see if creating a blank gifted variation on the main overlay will fix that!
yep that is exactly it π all good then! π π
@broken coyote I found the bug, why clips were triggered randomly although I deleted all triggers. If someone just posts an exclamation mark in chat, it triggers all clips I deleted the trigger at once π
Haha glad you found it. Iβll troubleshoot it tonight
how do I pull a specific json object with "${customapi.link-to-api.com}"?
Hey guys I found a bug on your website where should I submit that to?
what's the bug?
just did, nothing happend
hmmm odd
is there a way to change the Accept header for a ${customapi} call in a command? for instance, icanhazdadjoke.com responds with a plain text joke if it received text/plain as the Accept header but customapi receives html back
The dad jokes API has an endpoint that only returns a plain text response: ${customapi.https://icanhazdadjoke.com/nightbot}
oh cool. Didn't see that one in the docs. thanks.
do we have a widget for stream markers yet?
or a bot command?

i know it's in helix, so we could technically
I'm having an awful time getting a background image to show up when I build an element in JS (trying to reference an image-input). I keep getting a cors error. Anybody familiar with how to troubleshoot this? Or did I just not RTFM?
Hello, I am wanting to convert over from slobs and haven't been able to get the chrome extension for importing my tips and alerts over in the last couple of days to work, keeps saying "An error occurred" What am I doing wrong? Thanks
@toxic dagger you have both the dashboards open when you try to import?
Well that was easy,π¬ Thanks again. Perfect. Why didn't I think of that.
You got everything from slobs moved or was that giving trouble as well?
im having an issue when im copy & Pasting HTML CSS coding to create a goal widget sometimes it shows the widget bar fully completed othertimes it just shows an x what am i doing wrong?
The inconsistency makes me wonder too, what could happen. Can you elaborate please @ancient citrus ?
What widget are you using for goal?
well because i use SLOBS as my OBS because well they have different features like goal widgets you can customise but they dont have a goal widget for Embers so i purchased a overlay package that has goal widgets for streamelements and im trying to copy and paste some coding for a different goal widget design and its just showing a x and the image
Oh... There are differences between SL and SE widgets. If you purchased package from NOD or Visuals By Impulse there is probably a "StreamElements" folder in that package.
i got it working before where it was displaying the text but it was showing the bar full
i know this already but im having trouble the the actual coding/ coding doesnt change on what platform you use
Coding doesn't change, but we have data for every widget provided with onSessionUpdate event and SL has specific ones for goals as onGoalUpdate and onGoalLoad
So if you are listening for SL specific events it won't work as SE doesn't emit them
i just wish one of you mob could have everything needed instead of having to use 2 programs together to make a stream work
@ancient citrus https://streamelements.com/dashboard/overlays/share/5e68f508507bad10cd2fcf81 this one should display embers
It may not be as fancy as your current one as it is kinda plain widget.
yes but i want something that looks good lol thats the downfall with elements its so basic i take pride in my goals and content
thanks but no thanks π
Huh. The widget I provided you has all the options to customize it via custom coding (so it can look like the one you pasted).
But it is on widget developers to provide compatibility for platforms.
Where did you get that widget from? We would love to help those guys to adjust their goal widget for SE too.
its a streamlabs widget as i mentioned before the coding worked besides the visual goal bar being full now its just displaying the x its okay ill just use another goal widget that doesnt match my theme
But you wrote, that you purchased this package and AFAIK only 3rd party companies do those packages.
yes so ive purchased 2 from nerd or die to give me the option to use the editor for widget as for some stupid reason you dont have the ability to add coding to a base widget in SE
What is this package name?
doesnt matter what the package name is lol if i was using the base package the goal would work but the visual doesnt match my overlay im trying to put coding in to change the visual aspects of the goal
for instance right now im using the NoD Arcana overlay
but this doesnt have goal widgets with it
so im using the coding from the coding from NoD Nova goal widgets with the coding from SL bit goal or stars goal for embers goal and like i said the text was showing and the amount but the goal bar was full
I see that Arcana overlay package doesn't contain goal widget at all and the only custom widget (chat) works properly with SE.
I am checking "Nova" now
I pinged Nerd or Die crew, so we can find a fix for that together. Once the fix is provided, you should be able to redownload your package and widget in query should be in "StreamElements - Quick Install" directory of your package.
the nova one works but it doesnt match i was using the base coding from nova to put different coding in
So. You have a working goal widget and you want to adjust styling of it. Right?
There are some parts of code that are different between SE and SL and if you doesn't keep them, widget will definitely stop working. It is JS/FIELDS tab mostly
You can definitely play with code in CSS tab, to adjust colours/sizes/positions and other stuff. But without coding knowledge you can easily break whole widget when messing with JS.
any chance that there is a way to get chat notification? for normal "chatters" and not only for follow, subs and all that? or anyone can make one?
been googling alot and there is a bunch that would like to have it.
its very useful for "small streamer" that maby get a bit to focused on the game, sence they/I dont have alot of chatters
@stiff pelican Try this one: https://streamelements.com/dashboard/overlays/share/5e9d618bf917a3b67db2002b
This one basically will play a sound file when somebody writes on chat.
works great π
Does anyone know how to make this with a css, and then on the three dots the name of the follower?
nerds, for a custom event list, how do you get {name} gifted x{amount} for subs?
instead of listing all of the sub names
Nice idea you have here! I am doing it now!
Streamelements speaks to kvstore with an authorization key that looks static to me, why it's not publicly available in the ux? I want to write something based on that
(I know I can set keys with SE_API in the environment but I have to do a part of it outside of system)
Can someone help me too plx?
@lusty pivot This is because it is for internal use only. If you want to use external service you might want to use: http://keyvalue.xyz/
Key/Value as a Service (KVaaS)
@primal wagon Sure! What brings you here?
I posted a video 2 hours ago
and I made that alert in AE, only the three dots must be replaced with the name of the follower
And I thought with some CSS this could be fixed
Ohhh. Sorry. I didn't notice that! Need to get a pair of glasses
Hahaha
WOW. If aftereffects can create html animations like that I am so surprised. You should use {name} there. If it appears in html/css/js it will be replaced with username automatically
Or do you want to replicate that as JS/CSS only?
I don't care that much if it is html/css/js as long it works
Maybe this is a base:
window.addEventListener('onEventReceived', function (obj) {
if (!obj.detail.event) {
return;
}
const listener = obj.detail.listener.split("-")[0];
const event = obj.detail.event;
if (listener === 'follower') {
type(`Input.NewFollower("` + event.name+ `");`);
}
});
const type = (words) => {
const heading = document.createElement('h1');
heading.textContent = words;
heading.style.setProperty('--length', `${words.length}ch`);
heading.style.width = `${words.length}ch`;
heading.style.animation = `type 3s steps(${words.length})`;
document.body.appendChild(heading);
setTimeout(() => {
heading.remove();
}, 6e3);
}
h1 {
overflow: hidden;
white-space: nowrap;
font-family: Consolas;
border-right: 4px solid black;
width: 0ch;
}
@keyframes type {
0% {
width: 0ch;
}
100% {
width: var(--length);
}
}
@rugged rapids does it work at you?
@primal wagon https://jsfiddle.net/4L08eomq/
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
Better use lx's code. 
in StreamElement it shows no text, only the green background
Ohh. Add that to HTML tab:
<script src="https://unpkg.com/typewriter-effect@latest/dist/core.js"></script>
On top of it
I was about to write that ;-). Remove that part of CSS code:
body{
background-color:green;
}
Hahaha, nice thx for the help!! 
How do I change the font to "Source Code Pro" and the font size so the alert is a little bit bigger?
Add to CSS:
@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@200;300;400&display=swap');
body{
font-family: 'Source Code Pro', monospace;
font-size: 30px;
}
On the very top of it
I'm having a bit of a regex issue - mostly because I don't know what I'm doing.
I'm trying to make a command from my bot that when someone says F in chat, it counts up 1 each time it's used.
Response: Chat has paid respects $(count $(1:)) times
Regex: ^(F|f)$
Any help would be awesome
If anyone knows how to do that command and also make it so if someone said "F something" It would give a different count/response for that particular thing too, that would be a lifesaver
(?i)^[f]$
Seems to work π
Does anyone have an idea on how to make it so I could have a command that makes an individual counter for different things.
So F says chat paid respects X times.
If they said F Sam Fisher - could I make it so the response is "Chat paid respects to Sam Fisher X times"
I've changed my username from TheEager to Eager and I lost my chat stats, Is there a way to fix this?
https://stats.streamelements.com/c/eager
@sturdy cloud Command response: Chat has paid respects to $(1:|me) $(count $(1:|me)) times. Expression: (?i)^([f]\s|f$)
Am I missing something or is the SE_API.sendMessage function not documented?
@tribal zenith sendMessage is just a function to forward information from other SE_API functions.
yeah I thought I was just missing a list of possible messages, but I found the switch case :D
I am still looking for a way to access the queue
so that widget animations would not interfere with subs etc
widgetDuration alone doesn't do the trick unfortunately
Hmmm, maybe queue is broken by other events received by onEventReceived?
like event:test or message?
This is the approach I was using for that: https://github.com/StreamElements/widgets/blob/master/CustomCode.md#js-2
that's what I used, but I need to listen for chat-messages
and I can't really test what the chat:featured event is for
I wonder if it is highlighted message. To be honest I haven't seen that event
oh seems like it is just used in another widget app/components/overlay-editor/widgets/custom/featured-chat/featured-chat.template.html . Apparently it displays twitch-chat with avatars
Re-trying this question during the week day to see if I have better luck. @static wigeon: One of the SE Champions looked like they tagged you in response to my question, not sure if you're the right person for this or not. Sorry to tag if not.
Hi, I've been trying to diagnose a problem the new OAuth2 developer API, but I unfortunately haven't gotten a response to my question from a week or so ago. I believe it was mentioned that there's a channel in here dedicated specifically to the OAuth 2 API, but I don't see it. If that's true and it requires a role permission, could someone let me know what's needed to get that? Thank you.
I am looking for some help in creating a "first" command so that when someone uses the command it would say "Congrats user you are first in and received 100 points! I cannot find anywhere in the documentation for the variables for the bot to auto give that person the specified amount of points. At the same time the command needs to tell anyone after the first person something different. This is somewhat of what i have so far even though i know its not right. (Congrats ${user} you are the first one in! You get !addpoints ${user} 100 ${pointsname}!)
Hello everyone, ive been wanting to do a custom widget, for dnd rpg streams. I was looking for a way to throw custom events. I learned that the wigets gets their info by reading from the addEventListener callback, and ive been trying to get a way to throw a custom type of event. There we already have a follow, message, redeem among others, what im looking for is to throw a event of rpg type, or custom. Because, we have widgets and functions that already work with those, i didnt want to make a workaround a specifc item on the stream store for example, id like a fully custom type, where i can manipulate the data inside the widget however i want. Does anyone knows if that is possible?
this is the current state
window.addEventListener('onEventReceived', function (obj) {
if (!obj.detail.event) {
return;
}
const listener = obj.detail.listener.split("-")[0];
const event = obj.detail.event;
if (listener === 'follower') {
type(`Input.NewFollower("` + event.name+ `");`);
}
});
id like to check if the listener is rpg for example
window.addEventListener('onEventReceived', function (obj) {
if (!obj.detail.event) {
return;
}
const listener = obj.detail.listener.split("-")[0];
const event = obj.detail.event;
if (listener === 'rpg') {
console.log("Imma rpg event");
}
});
hey folks - general directed me here about seeing if anyone has the bandwidth for a custom widget commission. I've struck out on fiverr trying to get folks to respond. If anyone is interested PM me for details (or i can post them here).
hi, how can I share a custom widget with someone? ideally by generating an url share. thx
Hi, I am looking to commission someone to help my designer develop a custom HTML ccs alerts, please let me know if you guys know anyone!
I have a few questions regarding fields on custom widgets. How can I recreate the disabled feature as seen in the text box for enabling/disabling custom fonts? And is it possible to add/remove/edit fields from within the field menu (ex. Number of text fields shown is based off of a number field)? I suppose these both might have the same answer.
@azure cipher Unfortunately there's no variable to add points to specified user, there are only default commands for that.
@tepid basalt You can listen to events emitted within system, the code you provided won't work if you don't have event emitter within same widget. Can you elaborate on scenario you want to achieve there?
@woven zinc The only way I am aware of is to share full code via external resources (like jsfiddle + pastebin for FIELDS json).
@lone gust There are no dynamic fields at the moment nor "disabled" attribute that can be triggered by other fields.
thx lx
Hi, does anyone know how to add custom events to the twitch loyalty points and connect those to weird effects like turning your lights on & off?
@viral patrol Hi, sooo, my scenario is: I have the roll20 website up to play my dnd games, and there i can setup custom scripts to do custom actions, like when a player does an action on the site, i can setup a script to use axios on another specific api. I had the idea of integrating those actions on the roll20 app, to my stream overlay, example: ( idk how familiarized with dnd you are, but im trying to make things simple) I have a player there that can turn into a creature, when that action happens a script there is fired. I want to make my overlay respond to that action by placing the image of creature that he turned into on top of his video image that i already have on stream. I already achieved that by doing a command on stream ( or i guess putting te SE_API to write a chat command by the endpoint usage), but dont want those commands appearing in chat everytime an overlay action is to be taken. So the next step would be looking for events, such as the follow, sub, and the other ones, if i could write a custom event type, throw that custom event type using the api, and then test for that custom event type on my custom widget, that would be the perfect scenario.
You would need something in the middle. Like webhook to websockets. Your game will send events to webhook, and emited to websockets (which are constantly listened by widget)
This is something I would think of: https://hook.io/
Hello there!
Did anyone manage to include the Google Javascript API to a custom widget?
I face Cannot read property 'init' of undefined error π¦
Hello. I was wondering if anyone had a custom API that prevents the bot from targeting lurkers or people that haven't chatted within a certain time frame, when using a fun custom command that is created?
Well, i dont have a problem with that, i have a code that i could use as a webhook middleware, the problem is that im not fiding the SE documentation on how to interact with it , i only found out how the Endpoint api works, but not how to use the websockets from SE @viral patrol btw, thank you for answering
So, you need your middleware to run on SSL (so there won't be issues with "insecure content") , then you can connect to websocket. https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications
Or maybe could I modify some widgets data in overlays from SE API?
@viral patrol much sad :(, thanks for the response π
@crude crest I'm just setting up your On Screen Commands Widget and I wonder, if there is a way to adjust fadein and fadeout time of the videos I added.
I have added some short clips and fadein time is too long π
@timber lark Hey!
yes, you can adjust the fadeIn value in the last function on the JS tab! the function PlayVideo
There's a fadeTo and fadeIn that are currently ('slow') you can change them to ('fast') or add the MS that you want exactly in those π
Ah, thanks a lot Zander!!
So i am working with my first client sort of speak to create a full set of alerts and overlays, i created them in SE and im having trouble sharing it, i know its possible because ive seen sam and harris do it for the alpha gaming channel, i can't seem to get a share link like they have
how does one go about doing this?
This feature is only available for selected accounts.
Since it sounds like you're working with one person, you can get them to add you as an editor in SE, then you can freely duplicate over your work and set it up on their account
when I use SE_API.store.set do I have to store an object or could I just store a number for example?
Is there any documentation for the events that are emitted via socket.io for streamelements?
@viral patrol Hey! I'm looking for a chat widget that purges messages that have been deleted. I tested your Custom Chat widget and it purges messages of people who got timeouted or banned. But it doesn't purge deleted messages. Any chance to get that added to the widget? π
Yes, it has to be a simple object. @tribal zenith
@cerulean dome There's JSON schema here: https://discordapp.com/channels/141203863863558144/259680142459142144/619851854439776266
Good morning all, I'm trying to set the X and Y position of a text element in my widget (text element is part of SVG group). Everything works fine in my local environment, as well as the Overlay Editor. However, as soon as I attempt to preview the widget, I seem to lose that functionality. Below is a piece of the code that summarizes the method I'm using. Am I using the wrong jQuery selectors? Any help is appreciated.
var textBox = $('#data__text').get(0)
textBox.setAttribute('y', bound.y + (bound.height / 2));
@rugged rapids hm that's a bit overkill, but thanks π
@lone gust You don't have to use get(0) since you're selecting an id and y is not an official attribute. You could just change the top and/or left CSS attributes and set the position to relative or absolute
Something like:
$('#data__text').css('top', bound.y + (bound.height / 2));
So... I accidentally removed the default.ogg sound and I want it back. Is there a way to locate the sound file?
??
Is there somewhere I can find the source html/css/js/json for the default editor widgets? like https://github.com/StreamElements/widgets but for the built-in ones i have access to in the editor.
I just want to make some small tweaks to one of them.
Hello @viral patrol , yes sorry to bother. I was able to connect on the SE socket, and authenticate. I was also able to catch the events thrown by the SE enviroment, but i wasnt able to throw myself an event. I tryied socekt.emit(<eventType>, <object>) and nothing goes by once i do that.
@night vine native widgets are not editable, but you can replicate their functionality using custom code. Widget-share and our GitHub is also a good resource for start
Is there a command to clear the chat?
@tepid basalt I am on my phone rn, please search this channel for SE_Test.zip it has websocket included
@tepid basalt I am on my phone rn, please search this channel for SE_Test.zip it has websocket included
@viral patrol Thank you! i`ll
@tribal zenith I attempted making the change you suggested but it didn't work out for me. I'm still not convinced I implemented your suggestion properly, sorta just tried changing a bit to test it out (it would require a bit of code rewriting to implement across the whole widget.). The text im attempting to select is within an svg element, and I'm suspecting that is where my trouble is coming from. In any case, what I'm still struggling to understand is why it works on my local server, the overlay editor but only when I preview it is when it stops working. If anyone is willing to help I can upload code and share a link
Ty @rugged rapids
Quick question, is there an existing endpoint for the activity list thats displayed on the SE dashboard? I'm essentially trying to get the latest followers, sub, donation etc. If there isn't, does anyone know of a good way of getting that info?
You can access the data here: https://docs.streamelements.com/reference/sessions
Thanks @rugged rapids
Guys, im so sorry for being such an inconvenience. But this reference from the ST_test tha was indicated by Lx, and Benno got the link. Has an websocket example, but the examples only shows how to catch an event, just if i was an widget myself. The only difference from the one that is on that zip from the website, is this code
session.data.session[data.name]=data.data; const updateEvent = new CustomEvent(data.name, data); window.dispatchEvent(sessionEvent); session.session.data = data;
Which is still inside an socket.on 'event:update' callback function. My need for the moment, is to emit an event, not catch it, any of those events that im trying with (socket.io) socket.emit(''event''), socket.emit(''onEventReceived''), or any other type, i cant catch it on the overlay page, or even with the others event catchers on the bot. Im really sorry for the inconvenience, and if you feel like not responding, i feel i already got my share of your attention. Thank you !
@viral patrol is there somewhere I can find the source for the native widgets to copy them into custom ones for tweaking purposes?
I just want to make CSS adjustments to the Recent Events widget so that THE USERNAMES ARE NOT IN ALL CAPS and the Tip/Sub/Follow Goal Bars to change the location of the quantities.
the default custom widget looks like it would be a good starting point for customizing the style of the events list, but it doesn't show up outside of the editor so that's a no-go
@night vine I could be wrong about the custom widget but it might have something to do with how the preview works...I've been struggling really hard with a custom widget I'm designing because the initial setup fires on the 'onWidgetLoad' event, much like the custom widget default. My widget also worked in the editor but not preview. But when testing in OBS it worked again. Sooo shot in the dark here but I dont think the 'onWidgetLoad' event is being fired in the preview screen..Give the custom widget a shot in your broadcasting software and see if it works for you there, it did for me
it does show up in my broadcasting software, but it's much more straightforward when I can get it in its own browser tab so that I can use the inspector
yes, i could inspect directly from the SE editor, but i often preview changes in the inspector itself and that would be a lot of reloading and not easily multi-screen-able
I 100% agree, I'm going to take another shot in the dark and assume that the preview isn't working as desired. I'm not sure what the point of the preview is if you cant get a full preview... I've spent the last few days trying to figure out why my widget wasn't working outside of the editor.. I actually didn't realize the issue until I read your original question to lx
This is also my first custom widget, so there could be good reason the preview works the way it does and I'm just not familiar yet
@lone gust you could test it by putting a console.log in onWidgetLoad and see if it fires in the preview tab. If you want to emulate events for the preview, you have to mark the checkbox that says "preview live on stream"
i use custom widgets for non-API HTML/CSS/JS elements which load up fine in my browsers, so the preview inconsistency probably has to do with the hooks/events
@viral patrol any thoughts why autopoll results show up fine in overlay editor, but not at live url?
@tribal zenith my default go to for error checking is a console.log, I got nothing in the preview window, my widget is also not based on any events so all that together was a big indicator to me that event wasnt getting fired for me
However, those logs worked fine in the overlay editor
Anyone have any idea at all why this might happen, using AutoPoll widget
(is this the appropriate channel to ask this?)
Can you screenshot the layers?
it happens even when the AutoPoll is the only layer @hardy walrus < i just put the watermelon behind it to make sure it wasn't showing up in white text
ok.. weirdest part is it works in obs Browser source. But not in Chrome.....
and reading up a bit, looks like other people are having a similar issue?
I've had issues as well, but seeing as how it still works in obs,its mostly just been a developing inconvenience for me
Wasted a couple hours trying to figure it out, not realizing it just works in OBS..
I was halfway through rewriting my code cuz I thought I was doing wrong..coincidentally this was my first custom widget haha
Hello all, I am curious if there is a way to access the fund fields located on the "public contest page." I am more interested in displaying the amount "bet" on each option than I am the total bets.
@night vine @lone gust @oak plume Hello! I see that there was a conversation over night about that bug preventing widget load correctly in current version of Chrome (We are working on that issue now). I hope the fix will reach our production servers soon. And about debugging: the one way to go could be adding --remote-debugging-port=9222 flag to OBS shortcut, so you can go chrome://inspect then in your browser and you will be able to inspect overlays running in OBS.
@night vine @lone gust @oak plume Should be fixed now
@fading aurora you can ask @viral patrol about it in this channel, he is the wizard that made the widget π
he is the wizard that made the widget π
@native trellis
We are lucky to have such wizards among us mortals
Are there any "event" dump of all the possible events from the https://realtime.streamelements.com some where? Since the documentation seem pretty completely dull regarding this. And overlay "testing" is not performing any of those events...
@elder wolf The only thing I am aware of is that one: https://discordapp.com/channels/141203863863558144/259680142459142144/619851854439776266
Yeah found that one too after a bit of searching, but not really sure what will be existing in what context etc. But I guess I'll have to be guessing a bit and test run it, worst case I'll have a bug to resolve π
Just a bit weird that it is not possible to "dummy" test the realtime websocket part with actual events through the overlay system I feel
Would make it a hell a lot easier for us developers none-theless
@elder wolf whenever you make a custom widget on the overlay editor, you get the list of the listeners on the Js part, as far as the event from the socket, there's that one that @viral patrol posted. I was able to connect, and catch every event sent by the realtime.streamelements.com. The only thing is that i wasnt able to publish an event on the api, even less a custom event. Lx sent the SEtest.zip , that has a event thrower, but those events only works on local test, they arent thrown on the api and caught on the online overlay editor.
So I am basically left on doing a bit of guessing nonetheless it sounds like π
Oh. I forgot to mention (I was actually dreaming about that issue). You cannot emit events on SE websockets (they are emitted automatically on events received from YT/Twitch/Mixer and so on).
I figured, but it would still be pretty nice of having some sort of "test" tool to execute the exact same flow as if it was a real event executing if you get my idea.
Similar to the overlay testing tool, but that can be used for testing code flows π
Well, so here my quest ends, if that was possible, id be able to make a fully integrated widget for rpg roll20 players/streams. ( that was my goal). So here lies my suggestion, a way to emit events on the SE websockets, or an http endpoint on the api, that internaly emit an event at the socket. Thanks for all the help @viral patrol
Due to security policies that would be a no-go. The only way would be listening to external websocket and performing actions based on that instead of events within window (native SE events).
It could be done, there`s oauth, and other ways to authenticate whoever is connected to the socket or trying to throw events on the api, that person could only thorw events on its own channel . But i get what you are saying, i'll try that way, but having a native SE way to throw custom events, would be a powerfull asset to customizing the channel. Anyways, thank you !
Hi guys, i want to make roulette with few bot messages, like "$(sender) started roulette, let's see what happens!", then random.pick from few options, like dodged, dodged EZ, t/o WITH message on chat. I tried using ${<start>:<end>}, but I think I'm too retarded to use this properly.
It's like ${/timeout XXX YYY : EZ, Russians won, this time.} or how? / sorry for shitty eng, i hope you understand my problem. ;x
Helloo, back with another basic question...in my custom widget when I log the 'fieldData' I seem to be getting all of the fields that I entered in the fields tab as well as fields that aren't there (original default fields, fields I've since removed)..i don't have any conflicting keys so its not causing me a problem, but its getting me right in my OCD and I'd like to clean up the fielddata object if its something i'm doing
@graceful cloak Unfortunately you cannot tie two responses to a bot command. This is the approach for Russian Roulette we can recommend: https://discordapp.com/channels/141203863863558144/424943321794871296/449137760989741056
@viral patrol i saw this, just wanted to be sure that i can't use my idea. Anyway, can you show me a example of <start>:<end>? Thanks for your time btw!
Hi all ! I use the fabulous widget "Dancing Head Alert" by @crude crest, I love it !! But now I wish I could put a sound on it, because I use it on command for my subscribers. It is not possible to do it via the widget, I tested in HTML but my notions are zero. Can someone here find me a solution?
@graceful cloak what exactly are you looking sure? I am not aware of those tags you mentioned. Where did you find it
Give me a sec @viral patrol
Also if you want to, we can move to #π΅π±οΈ±polski
Oh this is a parameter where you can specify indexes of words that you want to forward to response
Like you have command !feeling love tea whatever here
And response could be ${sender} ${1:2} is ${random.1-100}% or ${sender} ${1}s ${2} for ${random.1-100}% First one will output XYZ love tea is 54% and second will output XYZ loves tea for 54%
I thought It's like bot will use cmd, then will write a message, like /timeout, then leaving a message like "haha, you lose"
Nevermind then, but thanks!
You are welcome!
Hey @viral patrol! You new widget "Twitch Channel Rewards Alert" does not trigger, if the reward does not include any text input. So in the example "Subgift" triggers the alert, the other two do not.
You can try clicking update items in widget settings
Definitely not. Can I have invitation link to your account so I can test it further?
Yup. I will be able to get there in some time.
Hey everyone.
Is there a good way for widgets within the same overlay to talk to eachother? Like a custom event or anything in that regard?
Someone can help me ?
@viral patrol @timber lark If you use the message event internally rewards have to have text. Otherwise the message event won't be triggered
I have a question about Video on command on streamelements site, regarding who can call the commands and how I can adjust the fields
Can anyone help me with this?
With this widget either the streamer, the streamer and Mods, streamer and mods and vips and additional users can call the commands, depending on your settings in the widget.
Ah ok, So lets say I want everyone to use a command
Use the stream store for that.
I relatively new to this, where would I find that?
Steps to make a command trigger sound/video on stream:
- Go to Stream Store page here: https://streamelements.com/dashboard/store/items
- Add an item that has these settings on it:
- Stream Perk
- Loyalty settings to your desire
- (Next step) Add contents (image and/or sound you want to play)
- "Redeeming this item shows an alert
- Redemable via chat
- Skip Requirements
- Get the item name/command from the 2nd creation page
- Go to commands page here: https://streamelements.com/dashboard/bot/commands/custom
- Add command with desired name and have response for command as: ${redeem item_name_here}
- Go to your overlays and edit the overlay you use.
- Click on "widgets" and add "Store redemptions" widget. Click save and you should be golden.
- Test your own command in chat and have OBS or editor open to hear sound/see video
Thank you so much! I'll have a look at it π
So I've got it working (somewhat)
Ok, next questions, how do I stop the video from playing the sound twice?
@fallen grotto Make sure to β βShutdown source when not visibleβ for all browser sources (all OBS scenes). If using studio mode, uncheck βSwap Preview/Output scenes After Transitioning.β Also keep in mind that sound can play from any overlay loaded in the browser (editor or launched). https://i.imgur.com/FegZJQS.png https://i.imgur.com/yY0wcFl.png
Nope, that's not the problem
I set the alert duration to 6 seconds and it's ok, but the video disappears before the end, if I set it to 7 seconds, the video plays, but then it plays again off screen.
You referring to the stream store item now, not the custom code widget, right?
Store item yes, I followed the instructions you sent - went to widgets and added store redemptions
I then edited the position and size
For that, best to use the helpdesk channel for your streaming platform.
But it is in the api though, should I still ask a helpdesk?
Ok, last problem here before I move over to helpdesk, I see when I set it to like 14seconds, the video does stop and stays there until it slides out, when it slides out and I can't see it, then it plays again.
Was told to ask this on her. So im running into an issue with a custom widget. I'm making a custom goal bar and added a background image to the container from a web url. it shows up just fine and looks great on the overlay editor but when saving it and displaying on twitch/obs, the background image disappears and just the content remains. can show images and code if needed. any idea why this is?
Did you guys ever add Linux support? I haven't been on this server for months.
@pulsar willow if you mean with OBS.Live or Ground Control we have not. OBS.Live source is available should someone be interested in porting it over.
But also suggest it should that beyond your capabilities
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.
Hi, is there any know issues with API. Last week my custom script constantly break. They worked excellent for for last 2 months. I'm trying to debug it, and can't find any issues right now. 
Does anybody have an idea of how long it will take staff to send client id and secret?
is there any way to add TTS to this overlay https://strms.net/twitch-channel-rewards-alert_by_lx
@viral patrol ^^^^

Sorry, there's no TTS for that widget unfortunately.

@tribal zenith Thanks for your information. I already requested update to widget description, that it works only for items that have user input.
Hello, a question, when will there be an update? The version of OBS in StreamElements is yes to version 20, the standard version of OBS Live is already to version 25, including the new features.
@spiral iris The new feartures of OBS v25 are already implemented in OBS.Live v 20. This is just another version count. Also next time this kind of questions are best directed to #helpdesk-selive
Hi! I'm trying to replace VIP permissions with SUB in @rugged rapids's "Video on command" widget, but the code doesn't work. For me and the mods it's ok but not for the sub :
let userState = {
'mod': parseInt(data.tags.mod),
'sub': parseInt(data.tags.subscriber.indexOf("sub") !== -1),
'broadcaster': (user === userOptions['channelName'])
};
if (!allowed) return;
if ((userState.mod && userOptions['managePermissions'] === 'mods') || ((userState.sub || userState.mod) && (userOptions['managePermissions'] == 'subs')) || userState.broadcaster || (userOptions['otherUsers'].indexOf(user) !== -1)) {
let video = $("#video");
let source = $("#source");
allowed = false;
video[0].pause();
@buoyant cape This widget only works for up to vip permission. Use the stream store for lower users.
Hey guys. Any way to create a command that pulls the user with the most gifted subs or the most bits cheered? Can't find a variable for this unfortunately.
probably not, but you can have that on top of your chat @wintry summit
top 3 overtime, top 3 in that month etc
got it. Thanks.
You welcome, @wintry summit .
@wintry summit If you wanna play around with the twitch api, I think this might help you: https://dev.twitch.tv/docs/api/reference#get-bits-leaderboard
If you open any of those files a widget should be added to your account into "Overlays" section
Hey does anyone know if the viewer queue overlay works for youtube?
dont really know where to ask the question, but ive tried adding my own custom cheers to work with the Hypecup, but nothing has changed as seems jank as hell?
Hello, i would like embed my store on my website, anymore know how i can do that ?
@polar orbit unfortunately not something that's really possible. Only option is to redirect to it as it doesn't behave with iFrames.
Hey there, guys! Was redirected here from #helpdesk-twitch.
I've been trying to align the text on the Event List widget in Overlays, but so far, seem to be out of luck. The bottom three lines seem to be okay, but the upper one just looks different and there's nothing I can do about it. Is there a way to deal with this issue?
I'd be very grateful if you could help me with this, or maybe suggest a better widget for my needs.
Where could I get documentation for websocket variables, for example for the contest, If i were to make a widget displaying ONLY the percentage of the first and second option of a ongoing contest
There is twitch connexion button ? Like facebook ?
@hardy oar I think that easiest way to get contests and contests details is: https://docs.streamelements.com/reference/contests and https://docs.streamelements.com/reference/single-contest
@polar orbit What exactly are you looking for?
You can login into StreamElements using Twitch/YT/FB/Mixer:
I do that
I've list of my product on my website
But i don't know what a user ?
This api work great : https://api.streamelements.com/kappa/v2/store/channel/items/itemId
but how can I get a customer to buy something with points? I don't even know what a client is
Oh. You can't redeem an item on user behalf at this moment using OAuth2.
Do you know how I can do it? My final objective being to put the store streamelement on my site.
Huh. I have no workaround for that one
are you trying to make a custom streamelements.com/[YOURNAME]/store ? ... honestly the built in store is pretty great
@simple tendon does a normal command Regular command !wins: "Todays wins: ${getcount wins}" work? replace the wins with rip or you variable.
ref: ```
You can use any {counter} with a corresponding bot ${count counter}.
A plain ${count} command will not work, you need to have a name for it.
Example setup:
Mod only command !addwin: "Updated wins to ${count wins}"
Regular command !wins: "Todays wins: ${getcount wins}"
And in the widget: "Todays wins: {wins}"
hi ground control not work
it worked then I accidentally touched something on the key and now it doesn't open anymore i restarted my computer I uninstalled and reinstalled the program but it doesn't open anymore I also uninstalled with revo unistall but it doesn't work someone have any solution?
@deft sparrow please do not post this in more channels than the one you already posted it in
Thanks guys, IΒ΄ve got it working π I deleted it and started again. I must have done something dumb. Thanks again for your help
Good to hear! Cheers!
Guys, if @viral patrol helps you, you send that mofo a donation!! He just got me out of a pickle. We don't deserve him.
Someone pin this π π€
I love to help. Tips are never required, but they are always much appreciated. I hope that I will be able to help in future 
Hey everyone, i havea question about using custom fonts on a custom widget! Is there anywhere i can upload the font on streamelements, and then use it from the fields.json? or someplace else i can upload it and then use a link?
#beermoney
Does anyone know how I would able to play a video file, then set it to repeat after a chosen amount of seconds?
Say, for example, a social media link.
But instead of an image, it's a video file.
I'm having a bit of trouble adding a google font through css. can anyone point me in the right direction?
is there a way to resize the bit icons/animations that pop up with the alert? i want to make them bigger and implement them into my alert's animation (they would be made to look like they're dropping out of a ball with confetti)
@ocean glacier You can add "slideshow/asset rotator" - this one should allow you to achieve what you want
I currently have my {death} set to 2 but, in the editor/ in OBS they are both on 0......
I've tried a bunch of different variables to get it to work but, to no avail.....
try just {death} or {deaths} NOT {<deaths> ...}
that is linked to a counter command @thick mantle :
@lean pond Replace whole font-face section from pasted code with @import url('https://fonts.googleapis.com/css?family=Bebas+Neue');
^ also class username -> font-family: 'Bebas Neue'
@elfin arch; I have tried BOTH {death} & {deaths}
And yes, I do have a !death command too.
what is you counter command? *the command with {count SOMETHING}
!deaths
Glenny has died ${getcount <death>} times.
!addeath
${count <death> +1}
!takedeath
${count <death> -1}
All 3 of these work.
Remove brackets <> from commands
did you try using {<death>} in the overlay?
Just tried it; no change....
^^ wasn't sure if the brackets are causing an error
Still at 0.
is your !adddeath now ${count death} ?
use it a few times in your chat, and the {death} in overlay preview should update
remove the < and > like lx mentioned (i trust they know the brackets are breaking it)
and i believe it defaults to +1 (but i could be wrong)
It defaults to +1, so ${count death} does the same thing as ${count death +1}
Well, I need to differ it from + & -
Only reason why I have tbh; also to not confuse myself. π
Sweet; works now, thanks @elfin arch
And I would change !takedeath to !resurrect π
make sure the !takedeath doesn't have brackets too π ... and your missing a d in add death π
Yeah, I changed it already.
thank lx for the bracket removal hint! (that was my step 3)
I have no active admins so, it's just myself anyways.
Just going to have it on my Stream deck so, I can just do it myself.
is there any way I could add a different color on $β¬ when I add it in overlay? like "β¬3 from X" when β¬3 is a different color than "from X" ?
You can prepare something like <font color="#ff0000">β¬</font>{amount} from {name}
^^ also looking for an answer on how to in-line style on the overlays (or if custom CSS is needed)
You are very welcome!
I'm making a custom widget that shows a css animation whenever a user uses a bot command called !pun. Can i use the onEventReceived eventListener to listen to the use of this command? Or is there another way of doing this? Please mention me if you can help me :)
In the listener for onEventReceived, the event type in obj.detail will be message
https://github.com/StreamElements/widgets/blob/master/CustomCode.md#on-event
Holy shit thank you! I was searching for this kind of documentation everywhere
Check channel header and pinned messages.
Yeah i looked, but i thought the overlay header documentation was meant to how to use the overlay editor lol
is there a way to change the looking of the media request widget?
Hello, My dashboard subcount number and my subcount widget on streamelements have different numbers. can someone help me with this please
Hello All, Just wondering if there is a way to get a real time youtube count as a label onto a twitch stream?
Is there a way to store a string somewhere through the custom widget/API between sessions?
@bright crypt I believe so. Never done it. https://github.com/StreamElements/widgets/blob/master/CustomCode.md then go down to SE API or On Session Update
Is there a way to use chat command variables in HTML, CSS, or JS?
Hello everyone! I was wondering: is there a way, in custom widgets, to make an option dependent on another one? I.e. having a dropdown yes/no and if yes, show additional options
Nevermind, fixed my issue
Hi its some way i can test my widget in visual studio code ?
or i need make them in the stream elements editor ?
@subtle radish You might want to check that: https://discordapp.com/channels/141203863863558144/259680142459142144/633144423055622165
This is not updated to current SE version, but most of the functions should work there
Please verify your YouTube account at https://www.youtube.com/verify
@shrewd verge The onSessionUpdate event is one that fires when an update happens and lets me fetch data, not store it. I hadn't thought about chat command variables, though. I'll look into those.
@pale eagle you would have to use the Youtube API to obtain the count, not sure StreamElements has that info. I actually have a widget that does that
You can use this link to get the overlay and widget, and you can use it or check the code to see how the subscriber count is obtained. this is the Event rotator shared by the Alpha Gaming Channel in one of its videos, with an added Instagram and Youtube counter: https://www.streamelements.com/dashboard/overlays/share/5de3a3f9ddf64fda82843533
I am wanting to make a command that counts how many times an individual user has used a command, rather than the overall times the command has been used. But I also want it to be universal so I can just have one command (!peed) that all chat users can use thats counts how many times that individual user has typed it
so I add a sound input to my custom widget, how would I go about setting the volume of that sound input
@restive veldt @bright crypt you can store values in variables using the SE_API
Specifically for @restive veldt it would require you to code all the command catching and the value storage/reading
https://github.com/StreamElements/widgets/blob/master/CustomCode.md#se-api
@steady iron And just to confirm, that stores between sessions? If I store something there today, I can fetch it on a stream next week?
yes, it is persistent
PERFECT! Thank you!! π
I used it to check how much time it had passed by since the last time a user made a comment in chat and based on the time range, I would trigger special "welcome back messages"
Ooooh. That's clever!
I was looking at using it + chat commands to let mods adjust UI components
@bright crypt i have a viewer que widget on the widget share. no stores user name. but you can hack it up to store what ever you'd like
I am looking for a way to access contest information in a custom widget. I have looked through the CustomCode.md and don't see anything contest related. I did find the Contests API documentation, but don't know how to implement it. Can anybody point me in the right direction?
You can use apikey to connect to https://docs.streamelements.com/reference/contests
does anybody know how to convert a hex color from the widget colorpickers '#121212' to 0x121212?
using javascript, that is
i don't even know what to call the latter format, but vanta js uses it for setting a color
Hi! Iβm not sure if this is the right place to put this. If not, apologies in advance. Can someone please tell me how to make the Simplified Levels Bar smaller? I can't seen to find a spot where its size can be reduced. Itβs the widget in the bottom right corner.
@languid knot You can go to CSS and add:
body{
transform:scale(0.5); /* or other value */
}
@ocean fractal AFAIK JS plays with HTML/SVG or other stuff. I am not sure what the format is. But if it is this change only you might want to use simple let color = fieldData.color.replace("#","0x");
Here's some sample code on their site
<script src="vanta.waves.min.js"></script>
<script>
VANTA.WAVES({
el: "#your-element-selector",
mouseControls: true,
touchControls: true,
minHeight: 200.00,
minWidth: 200.00,
scale: 1.00,
scaleMobile: 1.00,
color: 0x6e8695
})
</script>```
basically, they're passing it in as a non-string datatype here. the replace doesn't seem to work because it's still in a string format
oh, let me edit that
Or:
var fullColorHex = function(rgb="rgb(123,123,123)) {
rgb=rgb.replace("rgb(","").replace(")","").split(",")
var red = rgbToHex(rgb[0]);
var green = rgbToHex(rgb[1]);
var blue = rgbToHex(rgb[0]);
return '0x'+red+green+blue;
};
Hmmm
This is not that still
As this will return string
yeah. the string format doesn't seem to take
ah i think i got it
Basically to get it into the format I needed, I needed to call the javascript function parseInt(hexString, 16)
it parses it to a base-16 number
so I guess 0x121212 would then be a literal hex number instead of a string
(i still probably need that rgb code since I still need to convert to this hex integer format, so thanks!)
Can anyone explain to me how the queryencode variable works and how you can have multiples in one command?
queryencode takes an input and makes it URL safe, which is useful for customapi links
!encode - $(queryencode $(1:))
!encode the cake is a lie
the+cake+is+a+lie
you can use pathescape if you need something like the%20cake%20is%20a%20lie
@AaroniusH#6398 https://css-tricks.com/converting-color-spaces-in-javascript/ This is what I found that might be helpful.
@mild cipher so no way to get multiple query parameters? example: !cmd item cost name and each of those are their own parameters? Guess I'll have to split it on my end.
and thank you for your response

Yep, you can just split it by space on your side π
@languid knot You can go to CSS and add:
body{ transform:scale(0.5); /* or other value */ }
@viral patrol Thank you!
is it possible to change the layout of the media request qwidget to let it looks like the aidinwallis spotify widget using css? if so can someone send me the code because i'm not good at css...
@viral patrol oh. I ended up figuring it out! I thought I followed up. I tested it out a little bit and found that even after fiddling around with the HSL, RGB, RGBA, and all that, it was spitting out the hex value I needed. I think I'm good lol
javascript:volumeControl = document.body.querySelector(".video-player video"); volumeControl.volume = 0.01;
Bookmarklet code for setting player volume to 1%, as needed by Twitch to count the view. Needs to be on viewer's local machine though!
I was curious, is there another system with the chatbot that could be used like the Quote's system which I could use separately from the quotes?
I'm currently using the Quotes system and commands, but I'd like something similar to be able to use in adding like a jokes database? If that makes sense?
Hey, does anyone know what the CSS would be to delay the appearance of text?
I'm trying to delay the appearance of "username" by 1 second. I've tried "animation-delay: 1s;" within ".awsome-text-container" but that didn't seem to work.
Never done any coding in my life, complete noob at this.
Please @ me if you know the answer.
"transition-delay" doesn't seem to help either.
@random pebble You should create another animation like
@keyframes appear {
from { opacity:0;}
to { opacity:1;}
}
and use it like:
.username{
/* whatever you have here */
opacity:0;
animation-name: appear;
animation-duration: 0.5s;
animation-delay:1s;
animation-fill-mode:forwards;
}
@twin condor You might want to check that one: https://thefyrewire.com/docs/api/twitch/pastebin/
@viral patrol Where do I add the text you suggested. This is what I have below.
font-size: 290px;
font-weight: bold;
transform: rotate(-3deg);
position: relative;
top: -485px;
left: 0px;
}
.image-container {
margin: auto;
display: table;
}
.text-container {
font-size: 16px;
color: rgb(0, 0, 0);
text-align: center;
margin: auto;
text-shadow: rgba(0, 0, 0, 0.8) 1px 1px 1px;
}```
I just want the .awsome-text-container to appear after 1 second and disappear after 10 seconds.
Hi, It's possible from custom widget to get the twitch icon from any event from an username ? π
You can use external service to grab user's avatar here: https://docs.decapi.me/twitch?endpoint=avatar%2F%3Auser
@random pebble I would need to have access to your account to check that as it may be more complex to describe it, because I don't see any animation here. I think the best way would be adding setTimeout in JS to wrap username after delay.
Does anyone know the details about the stream boss and the variables it uses? I'd like to have a script that sets it to the maximum HP if the current HP goes over the max HP. Is this possible?
is it possible to change the layout of the media request qwidget to let it looks like the aidinwallis spotify widget using css? if so can someone send me the code because i'm not good at css...
Hello, my OBS get crashed everytime when I start it since your new Streamelements OBS.Live Update. Nothing is working and I don't want to download OBS!
That is the crashmessage
I know it is possible to create commands using widgets, but can you create commands that require a certain many loyality points to use from widgets
Hey just wondering if anyone is available to create an event list and a countdown clock please. Thank you
How can i get total follower count in a custom widget?
I'm trying the follower-total.amount thing but it's not accurate
Twitch says i have 35 follower but streamelements says i have 24
@elder dragon Please logout of StreamElements at https://streamelements.com/logout and then login again to your account (Twitch/Youtube/Facebook/Mixer)
is it possible to change the layout of the media request qwidget to let it looks like the aidinwallis spotify widget using css? if so can someone send me the code because i'm not good at css...
Would it be possible to make a countdown clock overlay that adds time when a button on a streamdeck is pressed?
For example set the countdown to 12 hours, when the button is pressed it adds 3 hours to the countdown?
Hi there !
As I mention on #590584291604561930 , Im developer and I would like to develop my own custom widget around Contests but I didn't find documentation about Javascript events about this feature.
I saw the github repositories. I guess the widgets one is very outdated but anyway.
My goal is to customize Contests because the default one is very ugly
@pulsar willow You may play with data from here: https://docs.streamelements.com/reference/contests
mmm ... do you know where can i find the source code of the current Contest widget ? I would not develop everything from scratch just to customize the template and stylesheets.
Thanks for your help @viral patrol
I think that there might be one with open source on widget-share channel, but I am not 100% sure.
How do you get notified about your Code Guru application? Just a Discord private dm?
@elder dragon that is correct, but it can take a while since all applications are done manually. The moment it's approved your widget will be added to the #widget-share channel and will be shared with the public π
Will i also hear if it gets declined? And also the reasoning behind it?
i believe so yes
Awesome!
guys, there is a streamer using this
https://github.com/StreamElements/widgets/tree/master/CustomEventList
but there is an issue with gifted subs display,
from 2+ gifts it displays correctly (X gifted x subs)
but with 1 gifted it shows Y subbed
is it possible to incorporate X gifted 1 sub to the code above?
ta 
Having an issue with adding points to many users in bulk with the https://api.streamelements.com/kappa/v2/points/ endpoint.
The points save for each user fine there is no response.json....
return fetch(`https://api.streamelements.com/kappa/v2/points/${setup.SE_ACCOUNTID}/`, {
method: 'PUT',
body: JSON.stringify(SEDataObject),
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${setup.SE_JWTTOKEN}`
},
})
.then(response => {
if (!response.ok) {
throw new Error();
}
console.log('Successfully Bulk Updated Leaderboard')
return response.json();
Node error for response.json(): ```
message: 'invalid json response body at https://api.streamelements.com/kappa/v2/points/5961d0a0c481d33bb8eb95c9/ reason: Unexpected token C in JSON at position 0',
type: 'invalid-json'
Points are updating as intended, it's just throwing an error when it gets to the json()
To analyse output you may want to check response.body() as it might be plai text response
response.body() gives error as not a function. response.text() does give "created" as a response. I wasn't sure if there was a full object like the single user point endpoint
i guess i don't really need a full return object anyway was just wondering if i was missing something. a simple return true/false is really all i need
Ohh.. Right. I forgot it is text() and not body... And yes, if the response is Created it is OK. There are several endpoints that provide plaintext instead of json.
thanks. everything was working except i was getting a catch error. in the future i'll check for plaintext responses.
Hi guys !
I read the source code from https://streamelements.com/overlay/scripts/app.js and it looks like some Websocket events are available like 'contests:running' etc.
On my local, i followed https://docs.streamelements.com/docs/connecting-via-websocket and it works : 'event:test', 'authenticated' are fired. However, I can't bind 'contests:running' and lot of other events. Do you know why ?
You can make a Websocket connection towards our API - this method requires you to use a JWT token.Each event processed via the websockets can be seen documented here:Code snippet for connecting to Websocket with OAuth2: Make sure that after you obtain your JWT token from: http...
did you set up the OAUTH scopes @pulsar willow ? I personally haven't used the SE websockets before. https://docs.streamelements.com/docs/scopes
Good point ! But why should I use OAuth2 instead of my personal SE JWT Token ?
i'm not sure... i don't really use sockets often and am not great with using them.
are you running locally and trying to get the running contests?
if you are doing a local bot you could use https://docs.streamelements.com/reference/contests
but i don't know how to get the socket to ping back when a new one starts.
Thanks mate for your help !
Yes, I run it locally and Im trying to get the running contest :)
I want to use websockets events especially to ping back the new context without calling the webservices every x seconds ...
hopefully someone else has a better (correct) answer to get the socket ping to get the contest info.... i'd personally cheat a little bit and read the chat for a bot response starting with "Contest started" then call the API for an update. π ... but the socket way would be much better
Your approach is very good but I'm capricious ! I know this event is available so I want to use it and nothing else π Someone from the SE IT teams there ?
socket.emit('subscribe',{"room":"contests::<ChannelId>","reconnect":true});
socket.on('contest:state',(data)=>{
console.log('CONTEST:STATE',data);
});
socket.on('contest:update',(data)=>{
console.log('CONTEST:UPDATE',data);
});
socket.on('contest:winner',(data)=>{
console.log('CONTEST:WINNER',data);
});
socket.on('contest:update',(data)=>{
console.log('CONTEST:UPDATE',data);
});
This is something I could find
there is a pin for using sockets: https://discordapp.com/channels/141203863863558144/259680142459142144/619851854439776266
next best guess would be to log theeventsand .... find it.... but lx would know more than me
When contest state is received and state is completed, you should unsubscribe from that contest
But I cannot find any event emitted when new contest is started
Thanks @viral patrol for your hint !
Unfortunately, I got Object { status: 1, message: "Invalid room specified" }
I will check again the source code
Did you replace Contest_ID with your currently running contest id?
I am updating structure, so it seems more clear (as it is not prepended via : character, there should be two of them in subscribe event)
Like:
socket.emit('subscribe',{"room":"contests::abcdef124123124","reconnect":true});
Ok my bad I did get it I should replace Contest_ID
So that means I can only bind event for a specific contest, not the current one ?
From what I see - yes. I may be wrong
I'll have a look on the app.js . It's very exhausting to read but I'll figure out π
Thanks mate
^^ but again, still not sure there is an emit when a contest starts
This could be some workaround - create a custom widget that will check for a message from StreamElements bot that contains "a new contest has started". At this point it should fire an XHR call to your webhook, that will trigger update of running contest.
Instead of hammering endpoint 24/7 π
It's exactly what I trying to avoid π
π€£ same thing i said about cheating 20 minutes ago. sometimes, you just gotta make it work
Bro @viral patrol I love you !
I found it !
Not
socket.emit('subscribe',{"room":"contests::<Contest_ID>"});
but
socket.emit('subscribe',{"room":"contests::<Channel_ID>"});
Now @elfin arch you can use websocket instead of hammering Endpoints π
i'll still read endpoints with my reading chat way π ... congrats and good find/persistence
are there any other things you can subscribe to with sockets? or is that it
what are you looking for?
hahaha; i was 90% hoping you'd say that. .... would be nice to have a list of sockets
yea
my guess is that almost anything triggered on an overlay can be triggered* to a socket.
I have a small question:
I want to customize my layout using subs, tips and such - so it's only me who needs an api token.
Assuming that most tokens are built around authentication, I assume the "bearer" token will only be forwarded towards the "redirect_uri" ... I don't really want to set up a localhost in order to obtain a token tho?
Did I miss something or should I really build a small webservice on my localhost in order to obtain a token?
If it is local service you can Auth with JWT token
Is there a 12h format for the ${Time.TIMEZONE} Variable?
@pulsar willow you can try using a custom api like this ${customapi.https://decapi.me/misc/time?format=G:i:s&timezone=America/Lima} just replace the format and timezone
Appreciate it, thank you!
It's working! Thank you @upper bough
Hey hello
Looks like the StreamElements API doesnt have any endpoint to gamble for a certain user?
how do you mean? you can make your own gamble function then use the points end point to update points.
@elfin arch yeah i thought of that
so there is no endpoint to gamble for the user right?
any idea how does the gamble function work like exactly?
how do you want to gamble for them?
like is it 50% chance
well
i want users to gamble their streamelements coins from the discord server
i already done everything from linking accounts and all
just need that one endpoint
PutPointsToSE: (username, points) => {
return fetch(`https://api.streamelements.com/kappa/v2/points/${setup.SE_ACCOUNTID}/${username}/${points}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${setup.SE_JWTTOKEN}`
},
})
.then(response => {
if (!response.ok) {
throw new Error();
};
return response.json();
})
.catch(error => {
console.error(`Error Saving/Removing Points for ${username}`)
return false;
});
};
that is the PUT function i use. points can be negative to remove
yeah i do know how to set points and such
just not sure how the gamble function itself is implemented
i want it to act nearly the same way (chance-wise)
is the twitch bot source code public?
Problem:
Attempting to convert ${user.time_online} from months, days, hours to only hours.
Using ${urlfetch} to grab the result hours from a HTML document with JavaScript.
Expected Result:
RiiaTako has spent 1995 hours watching VoX_E
Actual Result:
RiiaTako has spent <html> <body> <div id="hours"></div> </body></html><script> var full = window.location.href.split("#")[1].split("%20"); for (let i = 1; i < full.length; i++) { full.splice(i, 1); } document.getElementById("hours").innerHTML = full; var hours; j = 0; for (let i = full.length - 1; i >= 0; i--) { if (j == 0) { hours = parseInt(full[i]); } el} watching vox_e
More Information
Documentation says ${urlfetch} will "Outputs the Body in plain text".
URL being Fetched: https://vox-e-convert-to-hours.now.sh/#${user.time_online}
Example of URL being Fetched from Chat: https://vox-e-convert-to-hours.now.sh/#2%20months%2023%20days%203%20hours
Thanks in advanced for your help! β€οΈ
Bot grabs resource as plain text, it doesn't evaluate client side scripts.
@pearl star you need to use a REST api or in your case just write the converting function on your side instead of using another service for it
https://discordapp.com/channels/141203863863558144/457957557470887947/690147907827269685
Having some trouble with this one. It is sending the message four times into the Discord.
Do you have it as single overlay? Or is that widget on several overlays and "shutdown source when not visible" is not checked?
A widget on one overlay right now.
Intent is for it to be on two.
Let me double check OBS.
It is not checked, correct.
Also, trying to get it to run a command from another bot in the Discord though I don't think that might be possible?
To be honest I don't know... And those multiple messages - I wonder what could be about that. Let me tag widget author @crude crest as he knows that widget way more than I do π
Ok, thanks. I recreated the webhook as well to see if something was funky but nope, still responds 2-4 times.
@viral patrol bud, would you be able to update the nerd code please?
https://discordapp.com/channels/141203863863558144/259680142459142144/705174297416695828
Sure thing!
iam doing a widget as a project for coding class, do i need to fill out the OAuth2 Application form to be able to make a widget?
Where can I find SE widgets original code? I just want to make some little adjustement, like rounded corners, to the ones that already are in the editor. I don't know how to code and I can't pay someone to make me a custom one.
And how can I use a custom font in a custom widget?
@unreal kestrel Hey, I havent' seen this problem - I'll check into it this afternoon for you though and see what's going on!
@main lodge You can prepare widgets within our system without OAuth. If you want to prepare something for yourself only, you can use JWT token to auth when accessing our REST API or websockets. If you are preparing something for wide usage (several users), you should use OAuth.
@obsidian lynx you cannot alter native widgets within editor, but you can recreate those widgets via "custom widget"
@viral patrol I know, but I was asking if somewhere I can find the code that are used in the original widget so I can build directly a Custom Widget and making the little adjustement that I need without build a completely new one from scratch (because I don't know coding, just some really basic knowledge).
You can adjust any widget in #widget-share, Widgets tab in "Themes" section of our website and from our github repo: https://github.com/StreamElements/widgets
Hey, thanks @crude crest 
@unreal kestrel I'm not able to reproduce this issue π¦ Are you sure you don't have it added to multiple sources or have the SE page open with the widget as well?
Definitely no to the first but the second I may have had the overlay editor open when I was trying it, I don't remember.
Gonna test it now with everything closed.
Nope just did double.
Right now the widget is in the overlay that generated when I clicked the share link and the one I copied it to.
The overlay I put it in is used in two different OBS instances across five scenes.
@crude crest :)
The overlay I put it in is used in two different OBS instances across five scenes.
@unreal kestrel
And this of course, isn't all at the same time.
That is just how many scenes and OBS that the overlay is added as a browser source.
Got'm situated π
is there a way to use intervals or timers in js?
setInterval hasn't done anythign fro me so far in the custom widget
nothing fires
seems like it's a very special environment
oh
no I'm just stupid nevermind
is there a reason none of my CSS is working like font-size, color and background-color?
<div class="main-container">
<div class='test' id='myTest'>MyText</div>
</div>
* {
font-size: 6.8rem,
color: purple
}
div.main-container {
background-color: blue,
}
β
.test {
font-size: 6.8rem,
color: purple
}
Is there a way to trigger a test donation or something else within the API?
One way I know of would be to test Alerts via the bell on the lower right corner of the Overlay Editor.
I am currently working on an implementation of the channel points. This should allow viewers to trigger things in the overlay
Hey gang, I expanded on the social widget to include additional fields for discord and patreon. What's the best way to contribute that back?
I didn't see it in the github repo
Does anyone know how to make a custom widget that grabs a twitch title or game category and displays it as text?
I have had a search around and came across the Twitch api and I'm just here scratching my head
@oblique tendon Here you are: https://discordapp.com/channels/141203863863558144/457957557470887947/588334872951783448
Coder man.
So I am still messing around with that same widget, I was able to fix it with the OG creator but this is a more generic question.
Do I have to change the "isMod" or did I redefine what "isMod" is by adding additional badges?
The code has a comment detailing how to add more badges but it didn't seem to work, it looks like I did it correctly?
that looks fine, @unreal kestrel
Not sure what other badges you would want to add, but basically just add || badge=== 'name_of_the_badge' at the end of the first line to add additional badges
(before the ending parenthesis)
Just trying to create a mod-only version then an everybody version with different intents behind both.
hi guys. i'm trying to get some help ( and failing ). I have quite elaborate alerts, 3 variations of each and sizes, I need the base canvas to be full screen but i need to adjust the positioning of each variation and scale. can i resize an alert without resizing the base canvas?
The easiest way is to create several alertboxes within single overlay with enabled alerts only for specified conditions.
So you have 3 alertboxes, one is for cheer 10k+ for example, you have that variation only on "fullscreen alerts" alertbox, and on on alertboxes "midle" and "small" you have same variation, but without sound, without text, without image (so if other alertboxes catch this event, they won't play any default stuff).
I have a few issues with the custom chatbox widget provided here: https://github.com/StreamElements/widgets/tree/master/CustomChat
I was hoping someone might be able to assist me. First issue I found is that emotes are not appearing the chatbox and the second one is that there is no option to include a text shadow like this https://gyazo.com/4a4f37206281383fc42b52b03ef05d8f
hi
@pulsar willow Those issues have been fixed. They are on our github repo now.
Okay so the tipping system works, it shows the notification on stream and it updates me on my paypal but any money sent to me via Stream elements tipping always says "Pending" on my paypal, with no option to accept the payment sent to me, if enough time passes eventually the transaction is refunded and cancelled how do i get my tips to go through? How i approve them? everything is set up properly i think for stream elements tip settings so i'm not sure why this happens. I'm pretty sure it's not a paypal thing because i was just sent money from a friend on paypal through paypal and it gave me the option to accept on paypal, but when ever it goes to my payapl via the Tip system on stream elements, it says i was sent money but it says pending, but i also can't accept it. I don't know what to do, i'm losing money here. PLease help!!??
@elfin ledge contact PayPal on this.
Hello! I would like to know if there is a way to increase the time of alerts on the screen, for example, an image appears more than 20 seconds (wanted 2 minutes) after being rescued in the store.
Because I'm migrating to Streamelements and I'm really enjoying it, but this 20-second option limits me.
I use some chroma key video commands to interact with games, so my question.
thank you @rugged rapids
I am making a random number picker command with the args being two numbers. I set up the response like this:
${user.name}, you have rolled ${random.${1}-${2}}.
But I ended up with the response in the pic. Is there a way to parse in command args to a variable's parameters like ${random.${1}-${2}}?
@dire barn $(customapi.http://2g.be/twitch/randomnumber.php?start=$(1)&end=$(2))
!randnum 5 9 will return a random number between 5 and 9, inclusive
ok ty. :3
hey there, I'm wondering what the ratelimits are for the api.streamelements.com/kappa/v2/speech? endpoint. I see that there's a 30 rate limit bucket, but are the refill-times public info? Not planning to do anything big, just came across this endpoint and it seemed too good to be true :P
Hi, I applied for API token but I did not receive any email from you.
@real dune Your request has should be done. Can you please check it? (Current version is on github)
@gritty aurora Rate limit reset epoch timestamp in miliseconds is provided via x-ratelimit-reset header
@static heath OAuth2 tokens are dispatched in bulks. I am not sure what are timeframes for that.
Hello there. I need help with coding a twitch alert that someone made for me.
got it thank you! @viral patrol
@pulsar willow What seems to be the issue there?
there are issue in chat commands > default commands > command keywords
any word can't be saved
@pulsar willow type a word there then press enter, so it is added to list, then you'll be able to save
I am making an API call to get the contest information that I need for a widget. It is working in the Overlay Editor, but fails to retrieve the information in OBS.Live. I have found my JWT token, is this necessary? If so, how do I implement it safely into the widget?
@plush rock I think you can use apikey which you can obtain on "onWidgetLoad". Example of something apikey usage: https://github.com/StreamElements/widgets/blob/master/CustomTopList/widget.js
Hello
I was hoping maybe some kind soul out there might be able to help me with a CSS/HTML issue I am having. I purchased overlays from someone and they provided me with custom CSS/HTML to get the overlays to work with StreamLabs OBS. The alerts work fine inside SLOBS but I am actively trying to move over to stream elements and when I plug the code in nothing works. I have confirmed all settings are set the same and everything is identical but for some reason the code just does not work. Any help would be greatly appreciated and if needed I am willing to pay someone to help me fix this as I know that time is money and your time is valuable.
Hey ^^ I dont know exactly where to put this question, so i thought its right to do it here:
Is there a good way to time the visibility of the name of a new follower/sub etc in custom css to match it with my alert?
You can do that in the animation settings for the alert.
@viral patrol thank you for that! All I had to do was declare the api and the problem was solved.
@tacit field with default alert there's a "Text appearance delay" box, and in custom code you can use:
- CSS animation like:
#username{
opacity:0;
animation: appear 1s forwards;
animation-delay:2s;
}
@keyframes appear{
from {opacity:0}
to {opacity:1}
}
- via CSS+JS:
#username{
opacity:0;
}
setTimetout(()=>{
document.getElementById("username").style.opacity = "`";
},2000)
@lucid gust You can hit me on DMs with invitation link to your account so I could investigate it here. Alerts should be working out of the box.
can you use multiple api in a single widget?
Sure thing. You can use different endpoints (not only StreamElements), to interact with within single widget. (Like you can check top tipper via SE_API and then when it changes, send a request to external service, that will trigger an action and so on)
cool, gotta make a widget for my final project for coding class and hav to hav a command to show currency, a dice game to bet on a certain number and a coin flip game to win currency
Ohh. If you want to interact with points system, you would need to use some kind of middleware (just to exchange information that requires JWT token). This is a good behaviour to not store secrets as plain text in a thing that can leak. For example - your teacher will see that you connect to SE API with JWT which is in code. Instead of that you can create a serverside app that will not need that auth.
sorry iam still somewhat new to coding stuff so thats a bit confusing for me, iam on my 11th week of coding course, we have done javascript, css, htlm and for a couple weeks c# and some other things for a bit, i havent got much training on computer stuff
so a widget cannot add/remove points? @viral patrol
@elfin arch it can, but it is suggested (like strongly suggested) to use middleware instead of pasting JWT within widget.
gotcha. ... like using a key in React or similar (it's visible in the right-click -> view source) ?
Imagine having a widget with JWT inside, then your URL leaks (and it has apikey only by default), but you check requests in developer tools in network tab
for what i need what api's should i use?
i can try sort out the hiding of the JWT later cnat i?
did you learn Node?
and can you use Node to build your chat game for your project?
.... and also, does your final project need to be a 'chat game' or is your professor expecting a HTML website for that widget?
@viral patrol Ty ill try it out
pjonp was that directed at me?
ya @main lodge
sorry. didn't tag you on that. are you sure you need to use a chat widget and not a website for your project?
so its a dice betting game, a slip coin game and a command to get the currency from the channel
well we decided our own final challenges and i thought doing a widget might make sense
would be good experience to make one for class and maybe get me interested in making more
was gonna hav a visual of a dice show up as well when its done
i personally don't know the widget system well. ... i use Node and local host bots.
not really dealt with node much aside from it gets made sometimes when doing javascript
i know how you could do it with a local bot and read/write points and make a CSS overlay to OBS.... but a built in widget is something i'm still getting my toes wet with
If you want to use it locally it would be possible too. Even with JWT token on your local computer.
^ that's what i know how to do
so i need to put the code into a github folder for the tutor to look at the code
You can put that on github, but without your JWT
like let JWT=""
If you use that: https://github.com/twitch-js/twitch-js (to read chat)
and /bot/say REST endpoint to send messages as bot
and /points/:channel/:user/points_to_be_added_or_removed
...side question; is there any benefit of using that over TMI (https://www.npmjs.com/package/tmi.js) or they the same?
not sure where Twitch is on their API... it was going to be helix like a year ago, but they seemed to back off
with the twitch-js what is it i need from there?
...you are creating your widget for Twitch? correct sorry for assuming that @main lodge
sorry for all the questions just fairly new to coding in general and easily overwhelmed
yea making a widget for twitch
basically, you'll want to build a basic chatbot with what lx said. get your tokens and get it to read chat.
so i use twitch-JS to make a local bot to read the twitch chat for the widget?
correct, step 1 is get the bot to read chat. step 2; build your logic and get the bot to respond to your commands. step 3; build in the Stream Elements API to edit the points; step 4: use sockets to create html/css overlay "widget" (at least my thought process, but there could be an easier route)
it asks about having a module bundler?
did you download that github project in a zip file or did you install it with npm install --save twitch-js@next ?
havent downloaded the zip yet, where i build my code is visual studio code, not too sure what a module bundler is
first question; are you using windows?
yes
do you have node installed?
not sure, originally was on mac when at college but once college closed due to virus i wasnt in to collect mac and if tutor made me install it on my windows pc i wouldnt remember...
you should go with tmi(chat only) or d-fischer twitch(chat, pub-sub,...) https://github.com/d-fischer/twitch
i vote for TMI as well; but twitch-js was recommend ... so might try that
it even has some examples to get you started -> https://github.com/d-fischer/twitch/tree/master/docs/twitch-chat-client/basic-usage
@main lodge open up command prompt and type node -v what do you see?
v13.11.0
create a new folder on your desktop. call it whatever you want; like 'bot for SE'
yea done that
@woven zinc looks like it's active... but requires other additional packages for chat?
@main lodge shift+right-click in that folder -> open powershell
no dependencies
nice didnt know u could do that
it says This core package only provides API and authentication functionality. All the other things are located in separate packages: twitch-chat-client - connect to and interact with Twitch Chat...
but i haven't personally used it before
type npm init @main lodge and that will start your project
ahh, I meant external packages. all of those are from the same dev
sorry what did i need to put in the folder first?
did i need to extract the twitch-js folder in there first?
nope. empty folder.
ok so i did the npm init in the empty folder
do you have a "package.json" file now in that folder?
no
says about walking me through creating a package.json file
"This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults."
yup go through the command line prompts.
"See npm help json for definitive documentation on these fields
and exactly what they do.
Use npm install <pkg> afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit."
oh it says package name: (sebot)
sebot works. you can change it all later
no file though in folder
did you go through all of the prompts?
there was no promts just what i quoted above
"This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.
See npm help json for definitive documentation on these fields
and exactly what they do.
Use npm install <pkg> afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
package name: (sebot)"
ah ok
then it will ask a version. give it 0.0.0
called it bedbot(group of sloths is a bed) and is says version:(1.0.0) below where i inputted name
give it entry of bedbot.js or index.js
and enter through the rest until it asks is this right? and tell it y
ah i had to giv it the version after i gave it the name, now it says description
"my project" or anything you want
yea asked entry point and i said bedbot.js and now it wants test command
press enter until you get to 'Y' question
and then just type y and enter
yup. and you should have a .json file
yea i do now
create a new file in that folder: bedbot.js
yea
so now you gotta chose what you want to read Twitch chat:
- https://github.com/tmijs/tmi.js (what i use)
- https://github.com/twitch-js/twitch-js (what lx SE support recommended)
- https://github.com/d-fischer/twitch (what someone else recommended)
so is this just for making a bot that reads the chat to test the code?
what do you mean by 'test the code' ?
sorry iam just lost on what the above are for?
what i am trying to help you set up is a Twitch bot. It will read every chat message and respond in your channel when someone says "!flipacoin"
yea thats what i meant above, the bot will read the chat messages and that tests if my code works
it's not really a "test" ... it's either working or it's not π
no; those are different options for your bot. let's go with #1
here is the doc page: https://www.npmjs.com/package/tmi.js
you want to type something into the command window
ok so in powershell i type npm i tmi.js --save?
yea. try that
yea i got some node modules folder and a package-lock.json file
create a new file .... 'hidden.json' or 'secret.json'
all the private info will be saved there.
do you have a Twtich bot account to use?
do u mean a twitch account to act as a bot?
correct.
yea
log into that Twitch account
yea logged in
in your hidden json copy/save this:
{
"D_OWNERNAME": "yourDISCORDname",
"D_OWNERID": "yourDISCORDID",
"D_PREFIX": "%",
"D_TOKEN": "dflkj39sdlkj_DISCORDTOKEN_odf_sdfkljsdfj3wvvkd9o49ndkaipmf0",
"D_BOTSTATUS": "online",
"D_BOTGAME": "testing mode...",
"T_BOTUSERNAME": "TWITCH_BOT_USERNAME",
"T_OAUTHTOKEN": "oauth:dfklj_TWITCH_BOT_TOKEN_sdfkj39",
"T_CHANNELNAME": ["youTWITCHCHANNEL"],
"SE_ACCOUNTID": "stream_elements_auccount_id",
"SE_JWTTOKEN": "Stream Elements JW TOKEN sdfkjhsdlf;kjksl;dfjlks;jdgkjhsdkfjhkjsdfhkjsdhfkjlsdhfkjlsdhfkjlshfdkjlhslsdfuhsdufhsdkjfnksjdhfkjdshfkjlasdhfkjhsdkajfhskdjhfkjasdhfkjsdhfkjhsdkjfhksjdhfkjsdhfkjhskfjh"
}
yea done that
fill in the T_ lines with your info
ignore the D_ and SE lines
for the Oauth line; go to https://twitchapps.com/tmi/ on your bot login account
ok and copy the text and replace all the text in there with my exact code given
yup; it should be oauth:.........
ok, bot name and channel name of bot dont metter if same right? or is channel name for the streaming channel?
channel name is your chatroom on Twitch 'irrationalsloth'
ok, is it cap sensitive?
ah and i guess botusername is twitch username of bot which i hav correct anyway
not sure π€ hopefully not
well ive capped the letters capped in name
correct. botname is the bot account to log into
cool, so got the bot channal, auth and user channel typed in
create a new folder .hidden and move your settings.json file in there
so just call it .hidden
Yes
ok thanks
... not sure the best practice on it.... but it's to hide all the tokens and keys
how does it do that?
you'll have to do that when you upload to github. hide (ignore) that folder
oh so i make it hidden when i upload it?
no. you have to manually hide it. it's a sanity check
You can create a config-sample.json in .hidden folder, commit it, but use config.json to production details and ignore it in git
yea thats what i meant like in the file properties
oh
oh so it just uploads a sample without the actual codes?
^ like what lx said. i have 2 files in there. 1 real one and 1 fake one. i posted the fake one above.
ahh, cool
where you filled in all the Twitch info π
yea
....ok so; now go to your main .js file.
ok
const Twitch = require('tmi.js'),
SETTINGS = require('./.hidden/settings.json');
//START TWITCH
const TWITCHBOT = new Twitch.client(
{
options: { debug: true }, //see info/chat in console. true to enable.
connection: { reconnect: true },
identity: {
username: SETTINGS.T_BOTUSERNAME,
password: SETTINGS.T_OAUTHTOKEN
},
channels: SETTINGS.T_CHANNELNAME
});
TWITCHBOT.connect().catch((err) => {
console.log('****Twitch Connection Error:', err);
});
TWITCHBOT.on('connected', () => setTimeout(() => {
console.log('+++BOT CONNECTED TO TWITCH CHANNELS', TWITCHBOT.getChannels());
},1500));
paste that in your file. save. and it should run fine π€
is the settings.json in hidden in yours my hidden.json?
should i change mine to settings.json instead of changing all those settings to hidden if so?
you can call your private file whatever you what...
i use: '.hidden/settings.json'
do not edit anything other than the second line if that is what you are asking π
ah right yes just change the connecting file name to my files name
was it npm start to run it?
node botname.js
oh so its node bedbot.js to run it
yup
ok thanks
π€
yea got that
it connected to your chat?
i got the connected to twitch channel message in powershell yea
lol, yea we hav had many times when us 6 students are coding along with tutor and half the time when we run the code someones will not work
good work! that was step 1.... the rest is up to you π
correct, step 1 is get the bot to read chat. step 2; build your logic and get the bot to respond to your commands. step 3; build in the Stream Elements API to edit the points; step 4: use sockets to create html/css overlay "widget" (at least my thought process, but there could be an easier route)
@elfin arch now onto step 2
so i know the general of making javascript do stuff, how do i get the javascript into the bot? is it reference the code or put the code inside the bot?
ive already got a bit of javascript from a previous simple dice game that ive recycled a bit
Could you tell me how to change the color of the chat text?
so i meant like making the the game and how to put it into the bot when someone does the command, is it in the node modules?
Twitch
@main lodge since this a academic project of yours; i'm going to say you have create every file you need. you can build it all in the .js file π https://github.com/tmijs/docs/blob/gh-pages/_posts/v1.4.2/2019-03-03-Events.md
@gritty depot use /color ?
But where do I put it?
are you talking for the bot?
i'd personally log into the account and change it. but you could create a custom mod command to respond with /color .... ...
There I could solve it, thanks bro
not sure if there is an easier way
when u say build it all in the js file do u mean the bedbot.js or separate js file?
build it all in the bedbot.js
ok
that didn't work?
I want to change the name of the text, not the nickname
When I use / color it changes the nickname not the text color
ya. /color sets the username color ... an action is /me
type a message in Twitch chat the starts with /me
oh, you mean like on the overlay?
I think so
can you give us a screen capture of the text that you want a different color? do a quick paint arrow
you want the overlay text white or add a background.... post that in #helpdesk-selive i'm sure that is a common (maybe pinned) message
@main lodge i should mention that the code i give you is using TWITCHBOT instead of client ....
TWITCHBOT.on("chat", (channel, userstate, message, self) => {
// Don't listen to my own messages..
if (self) return;
// Do your stuff.
});
would client be streamelements?
no; there is no streamelements yet.
ok, what is the client part?
const TWITCHBOT = new Twitch.client(...
there is no 'client' in the code template i gave to you.
TWITCHBOT.on('connected', () => setTimeout(() => {
console.log('+++BOT CONNECTED TO TWITCH CHANNELS', TWITCHBOT.getChannels());
},1500));
oh right, so what did u mean with it using twitchbot instead of client? is it meant to be something else?
when you read the Docs on https://github.com/tmijs/docs/blob/gh-pages/_posts/v1.4.2/2019-03-03-Events.md and see a client.on those won't work with the template you have, because we used TWITCHBOT.on
isnt that just the const name? couldnt i just change that?
yup. you can. just giving you a heads up incase you were copy-pasta'in code π€£
ok cool, was just confused there for a bit, thanks for all the help
how do u hav no role with all the help u do lol?
thanks! .... i don't know the API too great and have 0 overlay experience π
Bonjour , je cherche une API qui permet de lancer une video au hasard , je m'explique dans ma scene de sub je fais gagner de la monnaie virtuel du jeu et en pour rΓ©sumΓ© une video est gagnante l'autre non , et pour rester dans l'esprit du jeu j'aimerais faire 20 % gagnant 80 % perdant
^ @hearty lake could you help Ospiris translate or help him out? π
π
i don't know if Rene speaks french
Nope, I don't, @upper bough
Sorry Rene, it tagged the wrong person 
@hollow bison I think that I would do that this way:
HTML:
<video id="vid" width="500" height="500"></video>
JS:
const winVids=['https://video1/file.mp4','https://video1/file2.mp4','https://video1/file3.mp4'];
const loseVids=['https://video2/file.mp4','https://video2/file2.mp4','https://video12file3.mp4'];
const chance=0.8; // Number between 0 and 1.
const volume=0.5; // Video file volume between 0 and 1.
// Adding lost wideo as placeholder
let toPlay = loseVids[Math.floor(Math.random() * loseVids.length)];
const randomNum = Math.random();
if (randomNum <= chance){ // It was a win, change video to winning one
toPlay = winVids[Math.floor(Math.random() * winVids.length)];
}
let video = document.getElementById('vid');
let source = document.createElement('source');
source.setAttribute('src', toPlay);
source.setAttribute('src', toPlay);
video.appendChild(source);
video.volume = volume;
video.oncanplay = function () {
video.play();
};
@viral patrol Merci , est il possible sur streamelements que la vidΓ©o ne se lance pas automatiquement ? Exemple : je clique dessus et le Gamble se lance
@hollow bison if you create a custom widget in separate overlay, then add it to OBS with checking "shutdown source when not visible" it should run your animation every time you make it visible in OBS.
@viral patrol thank you , donc pour ajouter cette commande je crΓ©er une source HTLM ?
I have an idea. Give me a minute or five
No problem
Yes. Video should autoplay on overlay load
If you have "shutdown source when not visible" it will pick a random video on each load.
merci ! peut on crΓ©er une latence avant que la video se lance ?
Of course you can do that. Just change:
video.oncanplay = function () {
video.play();
};
to
video.oncanplay = function () {
setTimeout(()=>{
video.play();
},10000); //10s*1000
};
Do you have videos for both sections? Winning and losing?
yes

