#dev-chat

1 messages · Page 30 of 1

mild cipher
#

@blazing cedar I had a go and I think I have something that works as you wanted.

I have a paste on pastebin that looks like this: (https://pastebin.com/T3hW8cvY)

:[thefyrewire_1] Response 1 for fyre...
:[thefyrewire_2] Response 2 for fyre...
 
:[ForgettableInternetGuy000_1] Response 1 for forgettable...
:[ForgettableInternetGuy000_2] Response 2 for forgettable...

and my command looks like this:

$(customapi.https://api.thefyrewire.com/twitch/pastebin/T3hW8cvY?filter=$(sender)_$(count "hr/$(sender)")&sender=$(sender))

and that's all smile1 now when thefyrewire (me) uses the command, the counter hr/thefyrewire gets incremented (I recommend prefixing it with the command name so you can easily remember it for later), and that count is in turn appended to the username and used as a filter for the pastebin (thefyrewire_1).

The next time I use the command, it selects thefyrewire_2, and after that, there are no more lines, so it doesn't return anything at all. You can easily add more responses by duplicating the line and carrying on.

#

To reset someone's counter, use !editcounter hr/<username> 0, or you can make a dedicated reset command so you'd only need !reset thefyrewire or something

#

If you don't want specific lines for each user and instead just want two responses for everyone, then remove the $(sender)_ part of the filter in the URL, so that only the $(count) is used as the filter, then on the paste, make the filters :[1] and :[2]

#

You should be able to change the response lines in the paste to be like:

:[1] /timeout $(sender) 1 Um, stop that.
:[2] /timeout $(sender) 10 I SAID STOP.
blazing cedar
#

oh man thank you

#

i didn't expect this

#

this is going to be amazing

blazing cedar
#

so now my only thingy is finding a way for the user to use the command that returns a response to the pastebin and adds their name, though I think that may be too complicated or not possible, right now - the channel I'm doing this for is often 200+ viewers strong so adding everyone individually may be a stretch, though I think I'll add worst offenders to start.

blazing cedar
#

oooh I got it

#

I see

blazing cedar
#

God I hope I haven't borked this troo much

steady iron
#

Pretty cool idea @blazing cedar

blazing cedar
#

Thanks, it was implemented initially due to monster hunter online, and t still exists but it needs abuse control and I feel like it's more of a drawback to have your timeout continually upped if you're spamming it than just being unable to use it

plucky cove
#

I'm trying to import my overlays and alerts from Streamlabs over to SE OBS.live via in OBS but it stops importing at 68 of 70 media files and it just never finishes. I left it on overnight and it still didn't migrate it. is there another way I can migrate my overlays? Also using a mix of Nerd or Die overlays and some custom ones

mild cipher
#

@blazing cedar Did it work out? 😄

blazing cedar
#

oof not exactly and I stopped working on it cause I found out my dad is really sick and might die

#

I'm no expert though so it was probably my inexperience more than anything else

#

when I've sorted out real life issues though I might jump in voice with you one night and talk to you about it if that's OK, I find it easier to communicate that way

#

if you have the time of course ❤

mild cipher
#

Sorry to hear that 😦 of course take of you and yours first. we'll be here when you get back SEheartbeat

blazing cedar
#

It's ok, it's kinda been a long time coming, but I appreciate the feels SEheart

fervent rock
#

Hi, anybody haw socket io event list, so i don't have to debug and collect them manually?

indigo flume
#

Hopefully this helps

fervent rock
#

@indigo flume thank you, perfection.

runic ibex
#

Hey guys, is there docs for the Widget Editor?

mild cipher
#

@runic ibex if you mean for custom widgets, check the links in the header 😄

runic ibex
#

in the header of?

mild cipher
runic ibex
#

ah lol, sorry about that. Thanks

lunar trench
#

can anyone help me with finding howto share a widget from stream elements for some reason can't i find the share or export function

indigo flume
#

Currently there is no way to share overlays, besides getting invited to the person's dashboard/accouint and duplicating it over

high swallowBOT
#

@lunar trench Follow these steps to grant managers/moderators access to your dashboard:

  1. Click on your Channel Name at the top of the dashboard and select Settings
  2. Create a new invite at one of three access levels (Bot Supervisor, Editor, Full Control)
  3. Send this invite to a mod/manager to give them access to your dashboard. The link is one-time-use and expires after 72 hours if not accepted
    Video tutorial: https://youtu.be/zl_h-ttZDF0
lunar trench
#

thanks, but i was searching like the links under #widget-share that i can share my creations with my viewers

indigo flume
#

That is staff only at the moment.

mild cipher
wheat belfry
#

Hello,
Using the window.addEventListener('onEventReceived', function (obj) {" event to display tchat (so when obj.detail.listner = message), work fine but in "obj.detail.event.data" the displayColor is always empty. Is this a bug ? I want to have the twitch color name
Thanks 🙂

mild cipher
#

@wheat belfry displayColor will be empty if the user hasn't explicitly set a username color, in which case it'll be random each time they reconnect to chat

#

Actually, it's random to each viewer, so it might appear as one colour for you, and another colour for someone else. In the same fashion, you could have an array of default colours and use one of those

wheat belfry
#

Okay so if they hve not set it we can't have same color for message posted by the same user ?

mild cipher
#

It'll be the same colour for the session, so you'd just need to temporarily store the username and the colour in an object and recall it when that user sends another message

covert elk
#

What are the ways I can get how many points a user has in my stream?

mild cipher
mellow flame
#

Looking to find a developer to help make a widget.

steady iron
#

@mild cipher might be your man

mild cipher
#

So might @steady iron blobthumbsup

steady iron
#

I'm disinclined to acquiesce to the request

viral patrol
#

And to be honest - the best widget ideas are picked from #💭︱feedback-and-ideas channel, so do not hesitate to submit your own @mellow flame ! Also if you need somebody who takes commissions for your own widget - provide such an information and I am pretty sure somebody will reach you soon 😉

full pelican
#

can i use some help here ? is there anyone available ?

steady iron
#

@full pelican drop your question or idea, and if someone is around, they will help

full pelican
#

i am basically trying to find a way to make an animated Text such As last follower or / and Last donator lets say a Slide Down Text

steady iron
#

There is a Widget that does something like that, you could take examples from it

#

let me give you the link

full pelican
#

can you tell the specific name of the widget so i can do it fast ?

steady iron
#

The Events rotator slides text back and fort

#

the Awesome Shoutout does a slide in, slow down, speed and slide out

#

both do it un a very specific way

full pelican
#

Awesome shoutout ?

#

where i can find that ?

steady iron
full pelican
#

hmmm i tried to use the event rotator thing

#

it seems there is no way to see the code of it

steady iron
#

Once you install it, you can see the code in your Overlay Editor

#

in Streamelements

full pelican
#

install what ?

#

all i see is ADD button to add the widgets

steady iron
#

that is what I mean by install 🙂

full pelican
#

what did u actually mean by see the code like access it using the page source option ?

#

never mind i got what u mean

#

thanks

steady iron
#

once you have it on the list of your overlays, edit the overlay clicking in the pencil icon and it will take you to the overlay editor, once there, click in the custom widget (the transparent object), and then click in Open editor, there you will see the 4 parts that together make it work:

full pelican
#

aha u said even rotator

#

that is a custom widget

#

that is why i went to something else

steady iron
#

they are all Custom Widgets, and this one is called Event Rotator, sorry about that!

#

and yes, for the widgets that are in the bundled Widget list, you can't edit or see their code

desert current
#

Is there a way I can make a preset for my custom alerts? Having to set it up for every single overlay is going to take insanely long

#

Please @ me if someone responds so I can see right away 🙂

#

Also idk if this is the right channel so feel to redirect me

steady iron
#

If you are gonna reuse a specific widget with specific settings, I suggest you put it in a single overlay and then reuse that overlay for different scenes in your streaming program, instead of having the widget on every single overlay inside StreamElements

#

@desert current

desert current
#

Hmm... I can make that work. Thank you!

#

Took a minute of thinking - I happened to only do it to my "over the game nothing but alerts" overlay LUCKILY

steady iron
covert elk
#

I need a user to be able to make purchases from my stream store through my app, how would I authenticate the user?

mild cipher
#

@covert elk authentication would be through Twitch, since not every user might have a StreamElements account

#

Once they've signed in with their Twitch account you'd have their username which you can use to check their points, subtract points when they make a purchase, and then redeem the item.

There's more info on each of those endpoints available in docs in the header of this channel.

wise vine
#

Hi Guys. I try to show in Streamelements Overlay the latest Subscribers like i did this in Tipeestream before. Since i moved completely to Streamelements, i try to rework the same scheme of showing the latest donations. In this clip https://www.twitch.tv/netcube/clip/EsteemedHotPistachioSpicyBoy you see on the top the actually scheme i try to rework in Streamelements, showing latest events by fading to the next one. I was only able to scroll these elements in Streamelements, but maybe i can rework this in custom CSS / JS. Do you have any suggetions? With JQuery Stuff which Streamelements Supports it should be possible, but i dont know how actually.

Twitch

Clip of Netcube Playing Minion Masters - Clipped by ImBabaJaga

▶ Play video
green sierra
#

I currently have a series of sub alerts that are all based around the same template but change colors based on number of months subbed. My question is, lets say someone subs for 6 months alert goes off, changes colors of my overlay. How do I get my overlay to stay THAT color until the next alert? Shroud has something very similar.

#

I understand that this requires some custom script, correct? What is the best resource to learn this? Anything specific to twitch overlays? Possible to implement the graphics I've already rendered in blender?

viral patrol
#

@green sierra Hi! The best way is to use custom widget to display an image and change it on event to another one. Imagine this widget as custom event list where limit of last events is set to 1 and each type of event is not a text X subscribed for Y months but display image for SUB_Y. You can have image={"0":"https://img.url/coin.png", 3:"https://img.url/bone.png", 12:"https://img.url/chest.png" where png images can be pngs with alpha channel, so it can be full screen or camera border or anything you want.

#

@wise vine Your question is also about custom event list - if you merge custom event list (to grab events) with event's rotator (to animate between elements) it should be able to replicate that behaviour.

empty mango
#

How can i get bitrate from streamelements api?

indigo flume
#

bitrate?

#

as in streaming bitrate?

empty mango
#

yes

indigo flume
#

we don't have anything like that via our API

#

what are you trying to achieve?

empty mango
#

When I write command "!bitrate" bot returns codec and transmission speed

#

(on youtube)

#

and i want to do the same through api

#

because I'm writing a bot for another website

indigo flume
#

and that command is with us?

empty mango
#

yess

indigo flume
#

Whats your username, as I don't think thats a default command

empty mango
#

Is there any way to return the answer to the command by api ?

#

ah sorry its custom command

indigo flume
#

What API is that command using?

empty mango
#

I will ask you a moment

#

I write this for the streamer that uses irl backpack

#

Gunrun Backpack

indigo flume
#

ok, so if their API can return codec and tranmission speed, it should be able to maybe return the bitrate

empty mango
#

somehow you can use their api via streamelements api?

indigo flume
#

via ours? no

#

I can't find their API tbh

#

idk why you would go through our API to connect to theirs tbh

empty mango
#

Because the custom command returns this data

#

So I think if streamelements already have it, it can return it to me,

indigo flume
#

and this encoder and transmission speed is taken from the gurnun API correct?

#

Without giving me the exact custom command to see what API its using

#

I can't really help much

empty mango
#

I will ask, I thought it was the default streamelements command

rotund rivet
#

Good evening, little question I have a problem with the games of the bot, I can not find the line of code to write the amount won or lost in the sentence, thank you

mild cipher
#

@empty mango you're probably thinking of the customapi variable. If you have a script, you can use it with that to return a response, but no, SE doesn't any information on the behind-the-scenes stream metrics, after all, you're not streaming to SE, you're streaming to Twitch, so if anything, the Twitch API is more likely to have that information (though it doesn't)

#

@rotund rivet which 'games' are you referring to?

rotund rivet
#

Roulette game

mild cipher
#

The variable for the amount lost or won is {bet}

#

e.g. {user} won {bet} {pointsname} in roulette and now has {points} {pointsname}!

rotund rivet
#

Thank you 😊

blazing anvil
#

Hello I have a mobile project for android and IOS that in this app shows the store items, their points.
The second purpose is to show a notification whenever the person posts on social networks, some post, example on instagram ...
Anyone with knowledge about this? Will be paid...

wheat jackal
#

How can I make so when sub event is sent, it checks if it was tier 1,2,3 etc?

rotund rivet
#

I have a problem when I put the command {bet} it gives me as a result always the sum bet and not a variable from 0 to 100. It's normal on the roulette wheel? @mild cipher

indigo flume
#

@wheat jackal Check the github link in the channel description

wheat jackal
#

@indigo flume did, but can't figure it out

indigo flume
#

data["subscriber-latest"]["tier"] - Tier of sub (1-3)

#

I believe you need to check like this:

if(data["subscriber-latest"]["tier"]  === 1000)
{do tier1 stuff}
else if(data["subscriber-latest"]["tier"]  === 2000)
{do tier 2 stuff}
else if (data["subscriber-latest"]["tier"]  === 3000)
{do tier 3 stuff}```
#

prime is also tier 1

#

but if you are doing code in the alert widget - do note that the widget handles conditions for you, so no need to check for that

mild cipher
#

@rotund rivet can you explain what you mean about the 0-100? The {bet} variable in the messages is the amount the user 'bet' and is how much they win or lose, is this not what you were looking for?

pulsar willow
#

I'm still sitting with that interesting project for achievements.

No dev myself at all, but it would be great to have a widget cycles goes through achievements (steam, xbox, ps4 idk) and lets people see if they're completed or not.

Don't think anything exists like that and if it's even possible, but if anyone want tot take that idea and turn it into reality, be my guest 😝

wheat jackal
#

How can I make if function with Top Donation (top tip)?

#

I saw that there is "sessionTop: false" in console, but I don't know how to trigger it with emulate button

viral patrol
#

If you are referring to custom widget (not custom code within alert, where you can just set a variation), just listen to onSessionUpdate, you will have top tipper there changed, but if you are using onEventReceived, just store top tipper as variable on load and then compare with it on each tip event (if it is true, trigger your code and replace value of top tip).

wheat jackal
#

@viral patrol I am using onEventReceived, how do I compare them?

wheat jackal
#

could you show me an example?

viral patrol
#

@wheat jackal

let topTip;
window.addEventListener('onWidgetLoad', function (obj) {
    const fieldData = obj.detail.fieldData;
    topTip=obj['detail']['session']['data']['tip-session-top-donation']['amount'];
});

window.addEventListener('onEventReceived', function (obj) {
    if (!obj.detail.event) {
        return;
    }
    if (typeof obj.detail.event.itemId !== "undefined") {
        obj.detail.listener = "redemption-latest"
    }
    const listener = obj.detail.listener.split("-")[0];
    const event = obj.detail.event;
    if (listener !== 'tip') return;
    if (event.amount<topTip) return;
    topTip=event.amount;
    //You can do something here

});
wheat jackal
#

<3

thick frost
#

Hi. Does anyone know how I can add the icon for the event in a goal widget? I try to show total number of subs, but it won’t show the icon :p

silent osprey
#

@thick frost Can you elaborate a bit? There is not option for an icon in the Total Subscribers widget

fathom plinth
#

hiya! I was wondering if someone could help with the nerd or die pixel pop alert i have on my overlays? i was hoping the new partnership would include this alert so i could customize easier (idk how to code haha) but rn its imported from stream labs and theres a few bugs. (sub message is hidden behind sub name, host alert says "undefined" in the corner)

broken coyote
#

@fathom plinth your using streamlabs?

fathom plinth
#

@broken coyote no, i have the pixel pop alerts from nerd or die but i can only get them to work on stream elements by importing them from stream labs

broken coyote
#

let me check something

fathom plinth
#

Okie:)

broken coyote
#

@fathom plinth currently the pixel pop alert isnt supported on SE. I assume once it gets ported they will have a 1-click install for it

fathom plinth
#

@broken coyote yes I know, it works when you transfer it from stream labs, it’s just a custom alert. I’ve had someone from stream elements set it up in the past for me. My problem rn is that I can’t code so I don’t know how to make a subs message appear where it’s supposed to be. The animation is a bit off for some reason

broken coyote
#

the animation is off, because it was created for streamlabs.

fathom plinth
#

Hm maybe I’ll just turn messages off then. Would you know why the host alert says “undefined” in the corner of my alert?

hot stump
#

I have a command that expects an unknown amount of parameters
I was using ${user.lastmessage} but that one doesn't work if one of the parameters is an actual twitch name, since it instead references their last message instead

I know about ${1} but how would I use that with an unknown amount of parameters ?

mild cipher
#

${1:} for the whole message after the command

hot stump
#

thank you I'll give it a try!

#

@mild cipher thank you once again, you are always a great help ❤

fathom plinth
#

wouldnt i just have to change a number or word in this to move the message text to a lower position?

rugged rapids
#

most likely the top percentage.

fathom plinth
#

its getting closer! it moved like a pixel haha thank you:) there deff something else to change to make it visible but oh well😅

#

i need to take a coding class lmao XD

broken coyote
#

There is a variable you have to add. I’m not at my pc currently to look.

#

I use that on my SE

fathom plinth
#

okie, no problem:)

broken coyote
#

I think I had to add the translateY. Can’t remember @fathom plinth

fathom plinth
#

hmm, if i scroll a bit down i see a translateY option but mine looks like this

broken coyote
#

That’s a different line

fathom plinth
#

yea, im not sure where that would go in the first picture i sent XD

broken coyote
#

It’s down farther

fathom plinth
#

aha! i see

#

gah, it supposed to be on the dark line XD my brain

broken coyote
#

I’ll send you my code. Give me a sec

#

Well my phone won’t let me. I’ll send it when I get home from work

broken coyote
#

@fathom plinth can u dm me

fervent rock
#

Anybody know URL for total youtube subscribers amount and current live-stream like amount statistic?

#

Can't find it, in V2 api description

indigo flume
fervent rock
#

Thank you @indigo flume , got subscription amount. But no likes.

indigo flume
#

Likes...YT Video likes?

#

I don't think we can track that via the YT API thonking

viral patrol
fervent rock
#

@viral patrol thank you, i called youtube api directly. It is pain in an asss 🙂

strong hollow
#

Hi guys. not sure if im in the right section. but im trying to set up a custom alert. i have the image. i have the text in place. but i need the text to disappear before it currently does. can anyone help?

mild cipher
strong hollow
#

i tried that bud but it only made it disappear later not sooner

midnight saffron
#

Sooo does the uploader hate firefox or something? I've spent the past two hours having to find and sort which files the uploader was willing to take and which ones it needs resent for the 20th time.... I'm not joking about the number of times I've hard to upload so far either.

#

Also while the uploader says it supports .OGG not a single file of the ones I uploaded went though

broken coyote
#

try using chrome

midnight saffron
#

^fixed. Don't like that it's google or bust but hey it's fixed.

broken coyote
#

yea gotta use dat chrome

#

*bling bling

midnight saffron
#

Chrome honestly screws with my computer, I only have it for when twitch acts up or I guess issues like this. It's rare for me to find a reason to use it otherwise, but to each their preferred browser choice.

fervent rock
#
export default socket => {
    // Structure as on https://github.com/StreamElements/widgets/blob/master/CustomCode.md#on-event
    socket.on('event:test', addEventsToList)
    socket.on('event', addEventsToList)
}
#

Hi, could somebody help. Test events are working correctly, but real life events are not working. Should i use different event namespace?

#

As i understand, there is no data difference between test and real life action. So i should be able to change event namespace and it should work.

#

Maybe there is something i don't understand, like overlay required to be open in background?

indigo flume
#

If you have the editor open, then the socket connection should be established towards our API

#

since you are seeing test events.

#

Unless you are writing it in something different then JS thonking

#

because I'm not sure what this is:
export defautl socket => {}

fervent rock
#

ES6

#

i created react app. Should i use 'event:update' instead of just 'event' ?

#

Or real life events have different structure the 'event:test' namespace?

indigo flume
#

afaik, they are different to some extent

#

console.log(event) should give you more information

#

when you receive a live event

#

but do note that if you replay from the activity feed to fall under event:test

fervent rock
#

Is there any easy option to generate real life events for testing?

fervent rock
#

Ok, i tested tips, data structure is completely different then provided by testing api.

#

this is what i got from socket api as response

#

json{ "_id": "5d7373391c708273f6681a07", "channel": "5d60f7798db52e6e4023d93a", "type": "tip", "provider": "youtube", "createdAt": "2019-09-07T09:04:40.841Z", "data": { "tipId": "5d7372a8ca6536b36128c68e", "username": "WuuEvil", "amount": 1, "currency": "EUR", "message": "", "items": [], "avatar": "https://cdn.streamelements.com/static/default-avatar.png" }, "updatedAt": "2019-09-07T09:04:40.841Z" }

#

API documentation provide completely different data type, or i am looking in wrong places?

mild cipher
fervent rock
#

@mild cipher And all my life I've prayed for someone like you. Thank you!

viral patrol
#

Hmm, that is strange for me. I was sure it was providerId not provider. I will add that one along

#

Oh. mea cupla. Looked at wrong scope

#

And I added "currency" as it was not in schema

#

JAVASCRIPT EXAMPLE AND JSON SCHEMA
Socket usage:
For socket connections we use https://socket.io/

let JWT = "YourJWTToken";
const socket = io('https://realtime.streamelements.com', {
    transports: ['websocket']
});
// Socket connected
socket.on('connect', onConnect);

// Socket got disconnected
socket.on('disconnect', onDisconnect);

// Socket is authenticated
socket.on('authenticated', onAuthenticated);

socket.on('event:test', (data) => {
    console.log(data);
        // Structure as on JSON Schema
});
socket.on('event', (data) => {
    console.log(data);
    // Structure as on JSON Schema
});
socket.on('event:update', (data) => {
    console.log(data);
    // Structure as on https://github.com/StreamElements/widgets/blob/master/CustomCode.md#on-session-update
});
socket.on('event:reset', (data) => {
    console.log(data);
    // Structure as on https://github.com/StreamElements/widgets/blob/master/CustomCode.md#on-session-update
});

function onConnect() {
    console.log('Successfully connected to the websocket');
    socket.emit('authenticate', {
        method: 'jwt',
        token: JWT
    });
}

function onDisconnect() {
    console.log('Disconnected from websocket');
    // Reconnect
}

function onAuthenticated(data) {
    const {
        channelId
    } = data;

    console.log(`Successfully connected to channel ${channelId}`);
}
cerulean dome
#

Hey. if I call my own endpoints through a chatcommand with ${customapi.https://... } the return is "The remote server returned status code 408 Request Timeout " but only if called through chatcommands... if i call the exact same url through a browser, everything works.. Any ideas why?

mild cipher
#

@cerulean dome I would suggest curl-ing or ajax-ing to it and seeing if you have any issues there. You may also want to look at setting Access-Control-Allow-Origin to * if you haven't already

cerulean dome
#

thanks @mild cipher curl-ing help. don't know why i didn't have the idea

#

seemed to have been some kind of https-redirect problem

wispy pagoda
#

I'm getting 400 Bad Request errors with no further details when trying to send a POST request to the tips endpoint.

#

Anyone mind taking a look at my request code and let me know what might be up?

wispy pagoda
#

Nevermind, I figured it out, documentation is...odd

quaint imp
#

How can i use API?

url = "https://api.streamelements.com/kappa/v2/channels/jinyerru/details"
headers = {
    'Authorization': f"Bearer {token}",
    'accept': 'application/json'
}

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

print(response.text)

return:
{"statusCode":403,"error":"Forbidden","message":"No channel authorization found"}

mild cipher
#

@quaint imp in the URL you should be using the channel ID, not the channel name

quaint imp
#

Thx

rough thistle
#

Hello all! I hope you're doing well 🙂 I am unsure if this is the right location, but I am trying to figure out if Streamelements has the capabilities to do this: I am looking to have some ads roll across- but I dont want them to be consistent. I would like them to roll across every few minutes. They are in video format. How would I go about doing this without having to press the on/off button each time

wheat jackal
#

btw there is a bug with custom chat widget - words with no space go over the bound box

balmy python
#

media request - is there an api for it? I see song request but is that the same control as for media request?

indigo flume
#

@rough thistle Make Streamelements an editor to your channel(or your custom bot name) and set a timer with "/commercial"

#

@balmy python Yes

balmy python
#

so then its the same

indigo flume
#

Yes

balmy python
#

ok

viral patrol
#

@wheat jackal This one is easily to be fixed:

.user-message{
    display:inline;
    font-size:{{fontSize}}px;
    word-wrap: break-word;
}
lean wyvern
#

Is there anyone who would be able to make me an overlay that scrolled all of the current subs with a transparent background? Ideally, I would like for it to scroll liek the opening star wars text, but I know that might be a bit tricky.

viral patrol
#

You can disable everything except subs

wheat jackal
#

I noticed that still with word-wrap: break-word; it gets weirdly cut on some letters.

#

but i noticed if you change width in .message-row{ flex: 0 0 auto; width:100%; margin-bottom:5px; background-color:{{backgroundColor}}; padding:5px; vertical-align: baseline; } to 98% it fixes the problem

ruby fox
#

any way to modify the aggregates data on widgets?

#

tried to get help yesterday with some duplicate/triplicate tip data and in the end it turned out it doesn't change due to aggregates being locked out of edit.

brisk matrix
#

Does anyone know if it's possible (or even better samples) of a Stream Elements overlay that gets information dynamically - eg. I've got a bunch of text / image elements that i want to be able to change on the fly as I stream. I could do it with local file sources in OBS, but would prefer to have something in StreamElements that calls out to a web service or something to pull content

viral patrol
#

If you have any webservice that can provide image url, you can do simple fetch(url).then(response=>response.json().then((obj)=>{$("#image").attr('src',obj.url)}); (typed in discord, might be wrong

gentle mason
#

Does someone know why videos freezes on the first frame, when playing them thru custom css in the alertbox widget? It seems browser related, since the video plays fine in OBS - tried all common browser, no success.

mild cipher
#

May be related to the browser's autoplay policy (blocking autoplay by default). This policy isn't enforced in OBS. Try checking the site settings for SE and adding an exception

gentle mason
#

That was my thought too tho, added SE as excepetion but without any luck. Weird is, that it only freezes with custom css - if i take a fresh alert out of the box videos play in browsers

viral patrol
#

It is because custom CSS are iframes (sandboxes) that are not interacted with before alert is being played. Regular alert is not iframe so it can be played even if "muted" attribute is not present.

gentle mason
#

Thanks lx for explaining, is there any workaround for that "issue"?

viral patrol
#

There were two ways I was developing custom widgets with video:

  1. make video muted within custom code, then remove mute attribute when it was done
  2. keep OBS open for tests (and mute SE Overlay Editor tab so I didn't hear sounds twice)
gentle mason
#

Yeh, i'm going with 2 right now since even when i add muted attribute it won't play - strange

#

Thanks

viral patrol
#
<video id="myFancyVideo" muted>
<source src="{videoFile}">
</video>
#

This should work, you can add autoplay as well

gentle mason
#

@viral patrol thanks. There is another thing i couldn't figure out yet, every webm i create plays thru fine until before the last frame, then get stucked/freezed and finish the video with the alert duration set.

#

Kinda strange to explain, the webm in aftereffects/streamelements-preview plays smooth - when executing the alert, the video always freezes before the last frame, pause for a couple and finish the video.

viral patrol
#

You can add loop parameter to video tag or extend webm file to have it repeated few times

gentle mason
#

Ha, that's the trick - cheers. Just for my understanding, what's the reason it get stucked in the last frame with "content"? By "content" i mean "visible content", not only transparent - if that makes sense.

lament vault
#

Just wondering, im new to CSS and im wondering how i can change the icon size through CSS here is the code area i thought it would be in. The images on the left is the thing im trying to change the size off

mild cipher
#

@lament vault the width is being overridden by the pop-in animation that you can see on line 129, which is the animation of the icon growing and shrinking slightly, so you'll need to make the adjustments to that, around lines 83, 84, 92 and 93

lament vault
#

thanks my dude.. That works 😀

mild cipher
#

@maiden meteor if by simple text counter widget you're referring to the inbuilt streamelements widget, and you don't mind something quick and dirty, then try this out:

se-widget-botcounter .content {
  animation: 60s fadeInOut infinite !important;
  opacity: 0;
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  3% { opacity: 1; }
  6% { opacity: 1; }
  10% { opacity: 0; }
  100% { opacity: 0; }
}

Add this CSS to the 'Custom CSS' field in OBS (in the browser source of the overlay with the counter). It should fade the counter in and out over about 6 seconds and runs once a minute. To adjust the time, you need to do some maths with the percentages and change the duration on the second line.

https://gfycat.com/defiantblondharborseal

wheat jackal
#

is there a way to view someone else's twitch chat, for chat widget?

viral patrol
#

Only by using twitch.js custom widget

wheat jackal
#

Ok

plain dirge
#

Is there a way for a widget to communicate with another widget?
Can I make custom events for the widgets to listen to?

mild cipher
north lynx
#

Hi, i was asking how to rotate text or images in SE. In my case i'm doing animations for my stream alerts but i would love them to be angled. I could do the angle on AE but then the text will need some rotation to match the animation.

proud drum
#

@mild cipher being a gamer in both Alpha Gaming and streamelements discord, love to see it

blazing anvil
#

Hello, would it be possible to get a store purchase of a streamer with this API ?, for example:
would have a list of store items, clicking a button on the list would buy that item.

mild cipher
#

@north lynx I'm on mobile rn and can't check but I think there's a rotate option somewhere on the side in the overlay editor? If not then you can maybe achieve it by adding some custom css in OBS

north lynx
#

@mild cipher Yes you can rotate but only 0, 90, 180 and 270 degrees... I mean to be able to rotate at your will. I don't know if i made my point clear xD

#

I know i can add CSS but my knowledge about programming is none. I'm only a graphic designer xD

mild cipher
#

@north lynx I'll see if I can check it out tomorrow when I'm back at my laptop, what did you want to apply it to, your alertbox only?

blazing anvil
#

Does anyone have examples of projects done in React Native with this API?
Because I never used it, a project would help me a lot to have the base ...

north lynx
#

Yeah i was thinking about it but i can workaround a no rotated alert, it dosnt really matter. But could be a great add to a next update that people can freely rotate the things

north lynx
#

¡Hi boys!

I've encountered another stone in my creative path which i think is more important than the one i've commented yesterday and, i do believe, really easy to solve. It comes in alert variations. There is no variation for "when there is a message" in the alerts box.

I am trying to do this horizontal bar to show the alerts and if there's a message i would love it to pop the vertical one as you can see on my example. To do that i've exported both videos and i was hoping to be able to do a variation for when the user leaves a message after donation or subscription. Unfortunately there is no such a variation parameter to do so....

https://i.gyazo.com/4f78c6ac975c1e500cc43486a736797f.mp4

charred tundra
#

Is this using a custom widget?

north lynx
#

Its using the Alert Box widget

charred tundra
#

I realize you're looking for a checkbox solution but in the meantime you could try adding a piece of JavaScript to trigger that animation or not depending on whether a message string came through. you would find this in here and use the documentation in the description of this channel.

north lynx
#

IF someone can handle me a code for that, i have no idea about how to code 😢

viral patrol
#

I think there is no need for custom code with that. You can change text appearance delay

#

Ohh, mea culpa. There are two rows. User message will appear same time I think

north lynx
#

You don't understand me. I want it to trigger between the animations if there is a message or if there is no message. Because i have an animation that is only the horizontal line

viral patrol
#

Oh. So it needs an JS code which selects animation file depending on message presence. And display text in correct moment.

north lynx
#

Could i get some help with the coding thing? >///<

Or is there any posibility that the SE platform ads the "If message" variation parameter? :p

atomic mesa
#

i want to create a custom command that plays out as follows

"a dragon has appeared! use !join to rally for the fight!"

!join - ___ has joined the fight

(timer) - the dragon grows restless and starts attacking

(timer) with a valiant effort, the (insert users who joined) defeated the beast, and have all been rewarded a split of the loot!

or

(timer) despite the best efforts, the heroes was defeated, the dragon flies off, preparing to fight another day

hollow venture
#

Hey guys, anyway to receive event from 'timeout' or 'ban' ing someone in the chat?

plain dirge
#

If you add an animation to elements in your overlay like static text, when does said animation play? I've created a command that unhides a source in my OBS and I would like an animation to play as soon as the source becomes unhidden. Any ideas? 🤔

north lynx
#

@here i am working with a programmer for the need of JS to perform the alerts thingy i commented yesterday. But we are encountering some problems. When we try to emulate an alert without message it pops automatically one of the messages from default, which is quite weird. Can somebody help us?

viral patrol
#

@north lynx The best way to check alert is to replay one from activity feed.

north lynx
#

Thank you @viral patrol:

charred tundra
#

is there reference code for using the regular StreamElements API within the context of a custom overlay widget? I can't seem to get it to tick using the default JavaScript examples.

use case: I'd like to pull in the latest running giveaway to make a custom giveaway display widget.

viral patrol
#

I think that regular API documentation with changed authorization method from Bearer ${token} to apikey ${key}

charred tundra
#

ohhh awesome, perfect 😄 thank you!

charred tundra
viral patrol
#

The only type like that is checkbox, but it is displayed in different way and returns true or false

charred tundra
#

yeah it's very ugly 😛 the UI designer in me is coming to terms with using it or not

broken coyote
#

Haha I feel your pain @charred tundra I ended up just doing a drop down menu

charred tundra
#

trying to help out a friend with a leaderboard overlay widget for resubscribers - running into some odd API 403 access errors:

function getData() {
  var date = new Date(); var timestamp = date.getTime();
  let newDataRequest = {
    method: 'GET',
    // url: `https://api.streamelements.com/kappa/v2/points/${channelId}/top`,
    url: `https://api.streamelements.com/kappa/v2/channels/${channelId}/details`,
    headers: {
      'Authorization': 'apikey ' + apiKey
    }
  };
  makeRequest(newDataRequest)
    .then(obj => {
      obj = JSON.parse(obj);
      console.log(obj);
    }).catch(e => {
    console.log(e);
    });
}

^ the above code works great when accessing top points, but the uncommented API line as well as:

url: `https://api.streamelements.com/kappa/v2/stats/${channelId}?interval=year&date=${timestamp}&tz=DE`,

both give 403 errors. am I doing something wrong or do these need extra permissions or something?

rugged rapids
#

the only thing I know is a common error source, is the channelID which is not the channel name, but their channel ID with SE.

charred tundra
#

right, which is grabbed earlier in the code (not included) which is how I got the other API points working so I don't think it's that anneThinking

charred tundra
#

do giveaway entries not trigger onSessionUpdate? FeelsWutMan

mild cipher
#

I suspect not, since it's a bot thing. Possible workaround might be listening to chat messages and picking out the entry commands?

charred tundra
#

hmmmmmmm

#

people can also join from the webpage though

mild cipher
#

Oof, true

charred tundra
#

so currently anything that does trigger onSessionUpdate will update the widget I have running but the actual entries don't 😛

#

so like, it'll probably get updated at some point, just not real time

#

what an odd conundrum

#

I should be doing dev for my day job not this but I've got the StreamElements widget coding bug this past few days 😛

mild cipher
#

😂 I mean, it's still coding

charred tundra
#

yes, I am practicing kappa

#

gotta keep the mind fresh somehow 😉

#

well as soon as I decide how to handle this, widget #3 is on the way AnneSquint

mild cipher
#

All the widgets!!! abongoblob ablobblewobble DJ

charred tundra
#

how often is too often to just automatically trigger a refresh on the widget so it grabs new data? I could have a counter and it gets reset as well every time a session update does happen as well, just to reduce calls

#

oh hey @mild cipher do you happen to know how to access top/longest subs data from the API, similar to how one can grab the top loyalty list of users based on points from there?

mild cipher
#

Hm, I don't think SE keeps track of subs in a full list sadly, and the session recents only has the last 25 FeelsBadMan it's possible through Twitch API but you'd need to send the user through auth which is a bit of a hassle

charred tundra
#

hmm yeah, I was just hoping the leaderboard was available in API format anneThinking

#

cause that data is clearly there

#

somewhere

muted dagger
#

Guys I'm having a little issue, I was setting up my new alert box, but just the host isn't showing up, the sound comes out, but the animation doesn't D:

charred tundra
#

can you share your code in a JSFiddle or something?

muted dagger
#

Sure

#

Anne you mean the JS code? D:

#

I lost myself here lol

charred tundra
#

whatever code you are using for the custom widget – HTML, CSS, JavaScript

muted dagger
#

Oh okay

#

It exceeds the characters, can send to you via PM?

charred tundra
#

no, please use JSFiddle

#

I might be able to help you so it's good for you to share it where other Code Gurus can see it as well 🙂

muted dagger
#

No problem I never saw this site before haha

#

just made an account

#

I think is this link

charred tundra
#

ohhh sorry can you also include your fields code either in a comment in the HTML or using a pastebin link? 😄

muted dagger
#

Sorry >_<

charred tundra
#

no worries!

#

this just makes it so I can set it up on my overlay to give a test and see if I can help find the issue 🙂

muted dagger
#

Oh okay 😄

charred tundra
#

hm it looks like you pasted in the CSS where the JavaScript should be

muted dagger
#

Let me double check

#

Oh yea, already updated :D

charred tundra
#

okay can you tell me:

  1. Expected behavior
  2. What exactly you are doing to trigger the behavior
  3. What exactly is going wrong?

Right now when I load up the widget I see the nice template layout happening

broken coyote
#

NoD borderline alerts

charred tundra
#

ahhh makes sense, was wondering whether that might be the case @broken coyote

broken coyote
#

They have a one click install. Did you use that or import from streamlabs

muted dagger
#

I use the quickinstall for SE

#

But would be working for me, right? If anne can see what I should see lol

charred tundra
#

idk if it's a host alert then it should only show for a host emulation

muted dagger
#

Oh you made as a custom widget, right?

broken coyote
#

I have the borderline alerts. I can cross reference yours vs mine when I get back from lunch

charred tundra
#

thank you @broken coyote – I haven't really worked with these before so I appreciate your helping on this one 😄

muted dagger
#

Oh no problem, anne, thank you so much for the first steps and MrBoost for the help too <3

viral patrol
#

Hmmm, this alert works out of the box for me

#

With provided code

#

But the number is wrong as it should use {amount} instead of {count}

#

Count is a number of event (for example we got {count} raid Today with {amount} viewers!

muted dagger
#

Hm, on the advanced settings is showing amount, can be something about my issue?

viral patrol
#

A little bit lower:

muted dagger
#

There is showing amount too O_O

viral patrol
#

Oh. So maybe autoinstall link fills that data already

#

As fielddata you pasted has {count}

#

Also - May I have editor access to your account so I could take a look inside?

#

Maybe there's something else happening

muted dagger
#

Of course :D

viral patrol
#

Please DM me invitation URL

viral patrol
#

@broken coyote seems like this is because of cached response from NoD CDN server that didn't have correct headers

broken coyote
#

oh snap

#

one of the downfalls to hosting off site

viral patrol
#

I wonder what is behind that - maybe one of CDNs didn't provide proper headers?

#

I sent that issue to Derek already

#

(But we managed to do some workaround to make it working on OBS)

lunar wraith
#

hello, i was referred over here by support-twitch because my events list, follower goals and alerts are acting really weird. I use the NerdorDie uplink package and my event list just doesnt show up. When i test an event it loads that on the list and drops my follower count from 231 to some random number

viral patrol
#

Oh. This is because of test alerts behaviour that they allow you to test whatever you have - goal, alert, event list, everything has something "new" to check it

#

Event list not being loaded on start is another issue

lunar wraith
viral patrol
#

Can you DM me invitation URL to Editor role to your account so I could investigate it?

#

Solved on dm

broken coyote
#

POW! @viral patrol out here knocking out problems like mike tyson

weary roost
#

Hey, I don't know 100% if this is the right place to ask but I have a problem with my follower goal bar, the condensed version stopped showing the fill bar on my overlay and I don't know how to get it back, It works on the uncondensed version but I very much like the condensed look but I'd like the bar. I don't know if this is a known issue right now but I've tried making a new follower goal overlay and the condensed version does the same thing. I checked to see if my fill color was at 0 opacity to see if that was the problem and it isn't, it was working in my last stream and now it is just a black bar that shows the number I have but not the progress via filling it with the purple as its supposed to do.

charred tundra
#

This is a known issue and devs are working on it. There is no ETA for a fix at the moment.

weary roost
#

Alrighty, thank you. I can live with it for a while, was just wondering if it was something on my side

pulsar willow
#

Still looking for a widget that can display achievements.

So lets say, if I stream Gears 5, I want the widget to display the achievements for Gears 5 (and say if they're completed or not completed yet), would also be cool if the widget can be selected which platform (Xbox, Playstation, Steam) 😄

tacit musk
#

That will require external API integration for each platform.

pulsar willow
#

but that would be possible right or not?

floral fable
#

In theory it may be possible, but it all depends on what you can get from an API. Looking into it for xbox very briefly, I only found a few things to get a list of achievements, and one was a private 3rd party API that requires you to be granted access and has rate limits on it.

pulsar willow
#

ahhh alright, sad, would be groundbreaking for us achievement hunters

viral patrol
#

Huh. I saw an achievement crossplatform tracking website few years ago

pulsar willow
#

yhea there are stat and achievement trackers ofc, but to turn it into a working widget

viral patrol
#

Can you give me one of those websites?

tacit musk
#

The new GOG galaxy has cross platform achievements tracking but you need to log into each account on the launcher to get that.

pulsar willow
#

I don't use any Lx

viral patrol
#

I found one and I think there could be a command as achievement list can be really long

#

So I would go with bot command with response like: Check my current achievements here: https://www.exophase.com/game/${customapi.https://decapi.me/twitch/game/${channel}}-steam/achievements/#YourexoPhaseProfileID

pulsar willow
#

im looking for a widget to display on stream tho, not a bot command or something

#

that scrolls through the achievements if you completed them or nor completed them

mild cipher
#

${customapi} and not ${game}? 🤔

viral patrol
#

Ohh. Forgot about that one.

#

Mea culpa

#

Huh. Also there is something else - game should be lowercase and with - as spacing

#

I see that this website offers "gamercards" you could use as widget (custom widget with <img src="URL-TO-GAMERCARD"/> only and it shows latest achievements

#

Maybe this could be enough for your purpose?

#

I think if you paste this into HTML tab of your custom code (and empty CSS/JS/Fields) it should add a widget into your overlay

#

Ohh. One thing, it won't autorefresh it, so I can write a small piece of code to reload image (cache breaker should be added there)

pulsar willow
#

oh well actually yhea that would be great for like in the mean time

#

does it only work for 1 platform or all the platforms?

#

Also I don't know how to do it 😅

viral patrol
#

I see that it can track achievements on 2 platforms. You fill up details here: https://gamercards.exophase.com/ and then you will have html code (you can paste as HTML code of your custom widget) or Direct Link you can use as your browser source

#

Also - I don't know this website, this is the first I could find, there may be more of them

pulsar willow
#

4 even

#

so sadly nothing we can directly add as a widget to streamelements

#

only 3rd party

viral patrol
#

I can create a widget where you can paste an image URL and it will be refreshed every 10 minutes

#

But yes, there's only third party for this purpose

#

So no design changes and you rely on external service.

pulsar willow
#

yhea i can't game on my computer yet, so don't use streamelements for gaming atm, but when I will, hopefully later this year, then I'd love to have a widget like that

digital cape
#

is it possible to filter an alert to a specific game? I have an alert i want to use but i only want it to happen when I'm playing a specific game.

broken coyote
#

Technically, it could

digital cape
#

what would i add to the JS tab to create this "filter"?

broken coyote
#

Well. How I would personally do it is. Build a custom widget that looks for that game, and if it’s active it will allow a custom alert to be fired

digital cape
#

so would it be something like

 if (game === 'NBA 2K 2020') {
broken coyote
#

With a lot more code. But yea

digital cape
#

yeah all the code would come after that but this would live inside the event.listener?

broken coyote
#

what kind of alert is it?

#

prob the easiest thing would be to make a duplicate of your current alerts. make one for nba 2k and have your normal. and just hide the nba ones in your obs if your not playing, and when u are. reverse them

digital cape
#

its an alert that pops and image on the screen and also does a web request. I only want the web request to happen when I'm playing a specific game and I want the image that pops up to be specific for that game. I know its strange.

#

Would this work?

window.addEventListener('onEventReceived', function (obj) {
  const listener = obj.detail.listener;
  const event = obj.detail.event;

  if (((game === "Your Game of Choice") && ((listener === 'cheer-latest' && event.amount === 100) || (listener === 'tip-latest' && event.amount === 1))) {
    "code for the alert lives here";
  }
});
broken coyote
#

Yea that’s a start to it

digital cape
#

Sweet!!!

broken coyote
#

There is a widget in #widget-share that grabs the game name u can use

digital cape
#

cool. whats it called?

broken coyote
#

current game

digital cape
#

sweet ill look it up. Thank you.

marble root
#

I have developed an function that communicates with the Norwegian Vipps payment services and I would like to get this integrated into Streamelements also, so I'm going to use the Streamelements API to input these new tips.

But I do have problem with the "tips"-API https://api.streamelements.com/kappa/v2/tips/xxxxxx . I also have the "Authorization: Bearer xxxxx" in the header (I can request and do other API-tasks).

I'm getting error in result from api.streamelements.com: {"statusCode":500,"error":"Internal Server Error","message":"An internal server error occurred"}

So I do feel that I have something wrong in the Body Parameters:
$postdata = array(
"userId" => "vippsuser1",
"username" => "VippsUser",
"email" => "testuser@bareentest.no",
"provider" => "vipps",
"message" => "Vipps-donation: This is a test",
"amount" => 10,
"currency" => "NOK",
"imported" => false
);

So what I'm missing in the parameters or doing wrong with the body parameters?

viral patrol
#

@marble root Hi! I think that instead of Authorization: Bearer it is better to use OAuth (ping Styler if you are interested in one). Also username and email should be nested in "user" array.

#

I just added addTip method to my PHP wrapper.

<?php
$api=new StreamElements($token,'JWT'); //Token can be OAuth as well, remember to change type
$api->addTip(4, "USD", "Test message", "JohnDoe", "John@thedoes.gov", "MyFancyProvider");
marble root
#

Thank you so much @viral patrol 🙂 This really was helpfull 🙂 Will do full testes this afternoon 🙂

viral patrol
#

Let me know when you have any updates. I will be more than happy to hear any feedback.

#

I hope that comments within this class are enough to make something out of it.

marble root
#

Hi. Its working. But I do found an error in the Wrapper about the limits:
On line 141: you have:

If I understand correct it should be:

In origin it will alway return false when you have remaining and reset time is in future. In my suggest it will only return false when remaining is 0 and reset time is in future.

When I do this correction, it is working now. Thank you. What I see from your wrapper is that I was missing parameters. But your wrapper helped me maximaly :)

So again thank you.

distant loom
#

I'm getting 0 results from https://api.streamelements.com/kappa/v2/points/[channel replaced with my channel name]/alltime. I tried adding a limit of 10 and didn't see a difference. I also tried it with the jwt secret added and saw no difference with or without.

mild cipher
#

@distant loom it's the SE channel ID, not name

distant loom
#

Ah thanks.

There's also what I consider ambiguity in the docs with the bearer token. Bearer 'JWT Token'. The token isn't enclosed in ' ', but is written as such. It also seems to not work the bearer token with https://api.streamelements.com/kappa/v2/channels/[channel name]/details only the /me variant worked even when I only used myself for /channels/channel/details

#

Oh wait I see it uses id there too

#

Not a fan of when apis use the same parameter name when it accepts different input

mild cipher
#

I don't think the docs are 100% complete yet, and probably won't be for a while as they're not much of a priority RIP but feel free to drop in here and someone will probably be able to point you in the right direction or clarify something if they have experience with it 😄

distant loom
#

Are the docs on github still relevant to create PRs for or is that pointing to the old v1 stuff?

mild cipher
#

not 100% sure, but I think that's outdated. It was using gitbook and the newer docs (in this channel's header) is using readme

distant loom
#

Ah yea that's right 😕

viral patrol
#

@marble root thank you for noticing that. I've added that the same time I added addTip. I really appreciate that

marble root
#

@viral patrol I did find also two other "potensial" errors. I found it because I was able to write wrong JWT token during the coding. Then I got error in PHP. I will suggest to change __construct($token, $auth) and getInfo() to get rid of the error and at the same time to "respect" the header info of the two functions:
(Just suggest to get the code "perfect" 😉 )

     * StreamElements constructor.
     * @param $token - OAuth/JWT Token
     * @param $auth - Authorization method (Bearer,OAuth)
     * @return boolean
     */
    public function __construct($token, $auth)
    {
        $this->api = new GuzzleHttp\Client();
        $this->auth = $auth;
        $this->options = array(
            'headers' => array(
                'Accept' => 'application/json',
                "Authorization" => $auth . " " . $token
            ),
            "debug" => false,
            'verify' => false);
        return $this->getInfo();
    }```

```    /**
     * @return bool
     */
    public function getInfo()
    {

        $endpoint = 'channels/me';
        try {
            $res = $this->sendRequest('GET', $endpoint);
        } catch (Exception $e) {
            echo($e->getMessage());
            $this->__destruct();
            return false;
        }
        $this->profile = $res;
        if (!isset($this->profile["username"])||!isset($this->profile["_id"])) return false;
        $this->channelName = $this->profile["username"];
        $this->channelId = $this->profile["_id"];
        return true;
    }
viral patrol
#

Thank you very much! I wrote this for myself, but if it has to be used by wider audience your solution is great

pulsar willow
#

Hello,
I'd like to receive every alerts on my channel with websocket so I follow your documentation available at this url :https://developers.streamelements.com/websockets
The client is succesfully connect to my channel but when I simulate alert from the overlay editor I receive nothing at all.
Maybe I forgot to activate anything in my account page. Can you help me ?

gloomy gazelle
#

Do you need the JWT token from a channel to enqueue songrequests on that channel through the API? My request looks like this:

        req = requests.post(f'https://api.streamelements.com/kappa/v2/songrequest/{secrets.CHAN_SE_ID}/queue', song_id, headers={
            'Authorization': secrets.SE_JWT_TOKEN,
        })

This works using my own channel id, but not on another channel's. The JWT token is from my channel. I'm a super-moderator on the target channel, but not a manager.

#

oh and the error is: {"statusCode":403,"error":"Forbidden","message":"No channel authorization found"}"

waxen jetty
#

Henlo developers and people of coding mind!

#

I've got an issue, I'm trying to make a command for StreamElements bot to use the Twitch Command /marker. But it's not working.
It types out /marker in chat instead of actually using it.
It can use the /me command though

#

The bot is Editor in my channel, so it should be able to use the command

#

It used to work without any issues back in March. But it seems some kind of patch or fix have broken this.

uneven oxideBOT
#

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

gentle charm
#

Hi Devs, it was suggested to me to post this issue here hoping to understand what's going on.

I been using OBS.Live (latest update) for the last 2 months without any issues.

I had 10 scenes with different elements but each one of them was using 1 browser source pulling an overlay link from SE.

Two days ago I started getting CPU spikes and overload with the video going through OBS lagging while streaming but also offline.

I uninstalled OBS.Live and installed OBS Studio 24.0.1 with exactly the same settings and scenes I had before.

CPU at 60% with just OBS Studio open.

I removed all the scenes containing the browser sources with the SE overlay links, CPU went down to 5% immediately.

I've wiped all my scenes from OBS and added some again.

Monitor Display
Starting - browser source with link to SE overlay
In game - browser source with link to SE overlay
Talk - browser source with link to SE overlay
Ending - browser source with link to SE overlay

CPU went from 4% to 25%.

It doesn't look normal.

The GPU is sitting at 2% so I doubt it's that causing the choke>

CPU: i7 6800K
Ram: 64GB
Video card: MSI 1080 Gaming x 8GB

Any help with this would be much appreciated.

pulsar willow
#

@gentle charm who recommended that?

gentle charm
#

@pulsar willow it was recommended to me by Carisus

#

I did ask to send it privately and I did to Carisus

#

This is the latest log

#

These is the result

pulsar willow
gentle charm
#

sure thing

eager ginkgo
#

If someone with a decent understanding of the alert box custom CSS has time can they talk with Taylorishere about some crazy things he’s thinking about doing with his alerts?

leaden fjord
#

Hi, I'm messing with my own custom alerts and I was wondering does your custom JS runs on every alert? I want to make an API call when the widget loads and cache the result for all future alerts

charred tundra
#

have a look at the Overlay Documentation in the channel description, it has examples for that 🙂 @leaden fjord

leaden fjord
#

I'll check it out, I should specify that I'm making a call to a custom API and not SE's API

charred tundra
#

not a problem, but the widgetload, etc. info is all there

leaden fjord
#

yeah but that's what confused me, for custom widgets I'd do fine with event listeners like widgetload, but when I started looking into alertboxes the code is not wrapped into any event listener which leads me to believe it gets ran every time an alert happens

#
//get data from the 🤟 StreamElements 🤟 data injection
const name = '{{name}}';
const animation = 'wobble';

// vanilla es6 query selection (can use libraries and frameworks too)
const userNameContainer = document.querySelector('#username-container');

// change the inner html to animate it 🤪
userNameContainer.innerHTML = stringToAnimatedHTML(name, animation);

function stringToAnimatedHTML(s, anim) {...}
#

that's how default JS tab looks like in an alert

#

I'm still reading through but I find it different to a normal custom widget

#

an interesting thing to know to build it on a custom widget instead would be how to make alerts queue one after another after the set duration just like in the alertbox, because when I spam events they get overlapped unless an alertbox component exists on the scene, it seems to bottleneck everything

viral patrol
#

Hi. Custom code within alert is a sandbox initialized on every instance of that alert, so your code gets executed every time if it is in main scope of that alert

leaden fjord
#

makes sense, would it be possible to bottleneck incoming events with your custom widget just like the alertbox does?

viral patrol
leaden fjord
#

thank you, hadn't reached that far down reading yet but that seems like the good way to deal with it, I appreciate it!

viral patrol
#

The restoreQueue method is a really nice way to go if your widget has dynamic duration. For example you set widgetDuration to 60seconds (as failsafe for resumeQueue if it doesn't fire or something strange happens) and then resumeQueue in your logic

leaden fjord
#

would that be the proper way to programatically set a widgetDuration? say I fetch from my API a duration that I want to keep consistent between widgets

viral patrol
#

Unfortunately not. widgetDuration is a property read by overlay itself to control widget inside. widgetDuration is a failsafe if you forget to resumeQueue (or if your fetch is really slow or something else) so it always fire at set time, but you can resume your queue earlier using resumeQueue method. For example you set widget Duration to 60 seconds, but in your code there is:

fetch(`url?user=${name}`).then(response=>response.json()).then(obj=>{
playAnimation();
setTimeout(resumeQueue,obj.duration*1000);
}
#

(Something like that. I wrote it directly in discord, so there might be some errors, but I wanted to show the logic)

#

So in that case your json from XHR call has "duration" property which is dynamic. If duration your queue will be resumed after that time if it is lower than widgetDuration.

#

In that case you have widgetDuration 60 seconds, duration from xhr call is 15 then queue will be resumed after 15 seconds. If your XHR call responses with ERROR or duration=124124124 then it will be resumed after 60 seconds (failsafe)

leaden fjord
#

the logic seems like the clean way to do it for sure, gonna be switching to a normal custom widget, thank you very much for the help! peepoCrazy

brisk stream
#

Hello everyone!

I'm designing a Widget and I'd like to know:

Is it possible that a colorpicker in HEX could be RGBA in the stylesheet? I know that the colorpicker lets you put the value in RGBA but I want the alpha to be as I want it to be even if the color changes.

viral patrol
#

Hmmm. As far as I know color picker puts value in whatever the selection is, if you set a default value to rgba(255,255,255,0.5) end user will be able to change that color, but most likely he/she will use only big field to change color and leave opacity untouched.

pseudo siren
#

Hi everyone SEheart

How to create a widget with ban or timeout detection?

The result should be a whip rupture.

Thank you SEheart

charred tundra
#

heya @pseudo siren can you explain a bit more about what you mean?

pseudo siren
#

If the moderator is banned user in the chat, a sound would be emitted.

viral patrol
#

Unfortunately I am not aware of any way to listen to ban/timeout events

pseudo siren
#

Ok. Thank you. SEheart

mild cipher
#

It's possible with TwitchJS

pseudo siren
#

Would you please help me?

mild cipher
#

@pseudo siren Someone else might be able to get to it before I do, but sure, when I get some time smile1

pulsar willow
#

How do I install rtmp server on ubuntu 18 I have tried every script on google with no joy

indigo flume
#

This channel is about dev stuff with our API, tools and features.

#

We can't help with that.

wispy pagoda
#

.

trail sequoia
#

Hi StreamElements, I am trying to grab data with javascript to create a custom overlay widget...Am I missing something do i need to include a link to your api? Where are the functions to access data such as recent-tips, recent-follows, recent-subs and that sort of thing....I am sure i am missing something as usual please give me a shout back when you get a minute...Many Thanks Turds

#

nevermind im an idiot lol

glacial forge
#

Hey guys, was wondering if someone here knew, I want to set up my own ! command for Twitch, I would need a database to store and access the data as well, if someone here had the ability to do so

trail sequoia
#

what did you want to do? you could make a simple bot with json

steady iron
#

Hello @glacial forge You can catch anything that is coming from chat, there are a few examples that show how to do this, for example the widget I made Awesome shoutout, you can grab the link from https://www.youtube.com/watch?v=PG_Gockk2V4

On the other hand, you can store data in the global object, which is persistent:
https://github.com/StreamElements/widgets/blob/master/CustomCode.md#se-api

If you need more like querying an actual database, JS by itself is not very well suited for that and I think it is better to use the global object to store and read data

viral patrol
glacial forge
#

@steady iron Thanks 🙂

sharp island
#

If a user is banned, you’ll get the delete-messages event now. 🙂

mild cipher
#

Awesome! 😄

pseudo siren
#

@viral patrol @sharp island Thank you! SEheart SEheart

muted dagger
#

So i added the uptime countdown code and it came out like this, does anyone know how to make the numbers bigger at all?

#

I used the code from here so if anyone can help id appreciate it

viral patrol
hot stump
#

what is a regex that matches anything? I tried . and .* but both don't seem to work

#

nvm . works 😄

torn condor
#

What is the timeline like for mixer support

charred tundra
#

there is no ETA at this time 🙂

timber lark
viral patrol
#

I think this won't be possible as code is obfuscated

indigo flume
#

@mild cipher will be able to help on that as its his code

viral patrol
#

+1

lusty portal
#

Does the custom alert allow for ajax calls?

mild cipher
#

@lusty portal hello from the other discord ablobwink

#

(also you should probably edit out that link)

lusty portal
#

@mild cipher Hello. 🙂

#

I did and it said it wasn't allowed... So yeah.. I'll repost..

#

This code ....

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

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

        const listener = obj.detail.listener.split("-")[0];
        const event = obj.detail.event;

        if (listener === 'follower') {addEvent('Follow', event.name);};
        if (listener === 'redemption') {addEvent('Redeem', event.name);};
        if (listener === 'subscriber') {addEvent('Subscribe', event.name);};
        if (listener === 'host') {addEvent('Host', event.name);};
        if (listener === 'cheer') {addEvent('Cheer', event.name);};
        if (listener === 'tip') {addEvent('Tip', event.name);};
        if (listener === 'raid') {addEvent('Raid', event.name);};
    });

function addEvent(action, username) 
    {
        var xhttp;  
        xhttp = new XMLHttpRequest();
        xhttp.open("GET", "http://www.nottherealurl.com/index.cfm?Username="+username+"&Hours=0&Action=Event&Type="+action,true);
        xhttp.send();
    };

doesn't work.

mild cipher
#

How do you usually interface with the db? Just through a link in the browser? Or through a dashboard?

viral patrol
#

I see one thing there. You are trying to GET from http where whole SE website is using https, that will be not able without --allow-insecure-content and --disable-web-security flags enabled, but the better option is to use https instead.

lusty portal
#

My website isn't https though.

#

So would it be

xhttp.open("GET --allow-insecure-content --disable-web-security", "http://www.nottherealurl.com/index.cfm?Username="+username+"&Hours=0&Action=Event&Type="+action,true);
#

Would that work?

viral patrol
#

Nah

#

I think there might be a workaround to that

#

https://cors-anywhere.herokuapp.com/http://www.nottherealurl.com/index.cfm?Username="+username+"&Hours=0&Action=Event&Type="+action

lusty portal
#

@mild cipher I have a page there that uses the URL variables to do things on the backend.

viral patrol
#

Maybe cors-anywhere will help

#

And those flags I mentioned - those are chromium flags, you could run OBS with them as parameters.

lusty portal
#

Ok.. Cors worked. Thank you very much @viral patrol

near depot
#

Sorry to be a newbie but I’m in search of a coder for a project

modest totem
#

Hi, I'd like to ask if it's possible to make streamelements bot run ads from my dashboard through timers or commands 🤔 thanks for your time peepoHappy (sorry if it's the wrong channel)

mild cipher
#

If you've added the bot as a Twitch editor, you may be able to make a timer/command with the regular Twitch command:

/commercial (default 30 second ad)
or
/commercial 30/60/90/120/150/180

graceful fossil
#

hi all, i am bot supervisor in a channel, and when i use my jwt token to update loyalty points on that channel i got

{
    "statusCode": 403,
    "error": "Forbidden",
    "message": "No channel authorization found"
}

what should i do?

indigo flume
#

You can't use your own JWT token to update points via the API on another account

graceful fossil
#

So I can only do it by having the owner's token? Is there really no other way?

indigo flume
#

Yes

#

I would suggest to ask for the API key instead

#

or what we have named it as "Overlay token"

#

instead of the entire JWT token

#

but note that both should be obfuscated

#

as both are secrets

graceful fossil
#

how i can use that overlay token?

indigo flume
#

instead of the JWT token and in the authorization part

graceful fossil
#

ok.. thank you 👌 🤗

viral patrol
#

I think that the best long term solution is to use Oauth with two scopes: 'loyalty:read', 'loyalty:write'

hot stump
#

I have a command that runs with every message and stores some values in an external DB
it doesn't give any output and has a 0 second cooldown

sometimes however, I get streamelements output

The remote server returned status code 400 Bad Request

I am assuming it's not my server so I am wondering, what it could be instead ?
this happens only sometimes for a brief minute

viral patrol
#

I think that having a command can be heavy, I think that the best thing you can do is to create that as overlay widget. Are you forwarding message to your remote server?

#

Or is it just a ping to it?

#
window.addEventListener('onEventReceived', function (obj) {
    const listener = obj.detail.listener;
    const data = obj.detail.event;

    if (listener === 'message') {
    fetch('https://yourServer.url/script');
    }
});

That within JS code of custom widget will send all requests from your pc instead of bot usage.

hot stump
#

I am using regex that basically triggers the command with every usage and I am forwarding the name of the person using the command to my server so I can give them points in my database for sending a message
it's all connected to a discord bot etc. as well

#

like I am super sure the server is strong enough to handle it , it's a 50 viewers max. stream

#

I am going to try it out with a 60 second user cooldown and see if it brings any changes

mild cipher
#

It would be better to do it as an invisible custom widget, because you're essentially trying to use a command every time any message is sent and the SE bot is probably having trouble with that.

hot stump
#

will that widget be able to register each sent message? never worked with widgets before, I would be super happy if you guys could direct me into the right direction

mild cipher
#

Yes, the code Lx gave you listens to chat events. You can basically just take the custom widget, strip out all the HTML, CSS, JS and custom fields, and use that as a starting point. The data object will contain more information about the message, e.g. the sender

hot stump
#

thank you! I'll try it out happy

viral patrol
#

Keep in mind that your server has to use https (as calls are from https, so protocol mismatch won't fire), if you don't have SSL - you can use cors-anywhere to forward your calls

hot stump
#

it does use https happy
I am looking at the overlay editor right now and I am a bit lost where I would insert things

viral patrol
#

Create "Custom Widget"

#

And then you will see "The Matrix" 😉

hot stump
#

not me being blind and just realizing there is a "open editor" button haha

#

thank you guys, I will try to figure it out from here PepeHappy

hot stump
#

okay so I got it running in an overlay with a test command, but the script I am fetching is getting executed thrice per message monkaS
I've used the code you gave me @viral patrol
I tried doing "return fetch(..." but it didn't help

mild cipher
#

Do you have the the widget open in multiple places? Overlay editor/OBS/browser tab, etc

hot stump
#

thank you @mild cipher that was the issue
trying to learn this so I appreciate all the support, thanks 😄

lusty portal
#

Is there a way to change the Boss battle name to someone else?

hot stump
#

is there a way to check what the data object contains? so far I am sort of just guessing but I need the userlevel and can't guess what it would be x)

mild cipher
#

Good old console.log(data) then check devtools

hot stump
#

oooooo thank you again
I see it in the console now, I'll try using it 😄

wheat jackal
#

Is there a way to detect a chat command and do something on custom widget when it's detected? aka Is there a code to detect chat command?

mild cipher
wheat jackal
#

thanks <3

quiet fulcrum
#

Hey, how do I set this up to display the Sub Bombs and then every single Sub Gift? So, for example, Anonymous snarls 10 subs and after the alert Anonymous gives Anonymous2 a sub? In one scene without the alerts overlapping ?

wheat jackal
mild cipher
#

You were close, just needed the quotes around the mustache variable

#f1 {
  background-image: url('{{theImageOne}}');
}
wheat jackal
#

I guess I have something else broken, because that doesn't fix the problem :P

mild cipher
#

Hm I guess so lol, since that actually works without quotes anyway blobxd console saying anything?

wheat jackal
#

weridly enough it doesn't lol

mild cipher
#

My next guess would be something funky going on with the element you're applying it to maybe

wheat jackal
mild cipher
#

Ahh imgur- there are problems with referencing images from imgur. It would be better to host on SE

wheat jackal
#

what about discord cdn?

mild cipher
#

Should be able to, but I was under the impression you were using image-input when you mentioned 'JSON data' aha

wheat jackal
#

I am

#

But can't you use example images first?

mild cipher
#

Oh, those are the fallbacks, okay

wheat jackal
#

I tried uploading to SE, still didn't work

mild cipher
#

Maybe double check the network tab

#

Also, the fallback is in the JS, but you're using the mustache in the CSS, which won't pick up on the default value. You'd need to set the source via JS if you want a fallback

#

Or if you just want a default starting value, adding the URL as a 'value` in the JSON would work too

wheat jackal
#

like url(https)?

mild cipher
#
"myImage": {
  "type": "image-input",
  "label": "My image",
  "value": "https://cdn.streamelements.com/uploads/ABCDEF.png"
}
wheat jackal
#

doesn't seem to work

mild cipher
#

If you want, DM me editor access and I'll peep it? It's probably easier

wheat jackal
#

sure

wise basalt
#

@viral patrol remember me? 🤣 I searched this channel, found a recent-ish post about websockets. I read through the schema you posted. Got my script connected using JWT (and also apikey). I am not seeing any test events triggering on the socket connection. Any idea?

viral patrol
#

@wise basalt Hi! Do you see those events on OBS? If not, this is the option that forwards them to websockets (and OBS):

lament hamlet
#

Is it possible to do a POST request to trigger a command in the chat? like if u post request !steam. it show the data that is inside !steam in chat?

mild cipher
#

I don't think you can trigger a command's usage that way. But you can GET the command details and POST the message as the bot I suppose

lament hamlet
#

Yeah, that is probably possible hm

burnt shell
#

Hey, i would like to get the 4 hightest 30 Tips in a Month. Is there some API example or a a final script?

viral patrol
burnt shell
#

great thank you

#

I guess they mean with let apiKey; the JWT Token?

#

sorry i can't it get to work

let apiKey;
let channelName;
let channelId;

Can someone explain me where to find this data?

mild cipher
#

SE dashboard > username in top right > toggle show secrets
The apiKey is the overlay token and provides limited access to certain endpoints. The full JWT provides access to all endpoints and is not recommended for use cases where others might see it (including in widgets)

burnt shell
#

Thank you, and ChannelName is this my Streamelements username?

mild cipher
ancient maple
#

Copied from helpdesk-twitch: Heya, @tender ridge said to ask in here if any code guru could help me move my custom CSS from streamlabs to streamelements. It's been the only thing stopping me from switching over for like... a year now... so it's probably time to get on that. Is anyone able to give me a hand?

tender ridge
#

If our Code Guru friends could give a hand here, that would be very appreciated!

viral patrol
#

Sorry. I was out of home. I should be able to help with that conversion. What is needed? Alert/goal/eventlist? @ancient maple

ancient maple
#

It's a sub alert. I can send you all the CSS for it in streamlabs. When I copy pasted to streamelements it just didn't work at all

#

I think because the classes or w/e are named differently in elements? I'm honestly not sure @viral patrol

viral patrol
#

Can you send me a dm with invitation link to editor role on your channel so I could investigate it there?

ancient maple
#

absolutely

ancient maple
#

@viral patrol I think discord dm'ing just died, I can't send you or anyone else dms right now

viral patrol
#

I got it

#

Working on it now 😉

small aurora
#

Hey Code Gurus! I’m looking for a really simple widget, I’m wondering if anyone knows of/ or knows how to make this: I’d like to have a donation goal bar appear and update after a donation but then disappear again after a few seconds. If anyone knows how to do this, or already knows of one, please @ or DM Me! 🙂 thank you!

viral patrol
small aurora
#

@viral patrol Oh that's great! Thanks so much! Could you tell me how to use widget data from github? 🙂 I don't have experience using github for widgets on here!

viral patrol
#

Create a custom widget and copy code to each tab of editor - html file to html tab, css to css, js to css and json to fields

#

And you should be set 😉

small aurora
#

That easy! So awesome, thanks so much for your help 🙂

viral patrol
#

No problem! Glad I could help you

#

And thank you for a nice idea 😉

small aurora
#

hahah it's super helpful, it makes getting donations and working towards goals classy and not like someone's asking you for money lol 🙂

mild crypt
#

Hey all, I'm trying to figure out a better implementation of the quote system. I had one when using Phantombot that would include the date its was quoted, what game was being played when the quote was done and who actually added the quote, but I can't seem to find an actual implementation of it. Is there a location where I can look through various scripts that have been created? I've googled it and can't seem to find anything that gives me a repository of where some scripts would be

molten mirage
#

Is there a way to keep track of session top sub gifter data

viral patrol
#

Unfortunately the only accessible aggregate is data["subscriber-alltime-gifter"]

molten mirage
#

if I have a pastebin link (example)

Can I show that pastebin link data/information on a streamelements overlay similar to a text source

charred tundra
cold wyvern
#

Hi guys, any way to get the amount of followers since the begin of the stream as a chat variable? (Wizebot has this)

clear girder
#

hi all, i want to change the Custom Eventlist (widget) from horizontal to vertical is there a option or i need to change some in Code? and if i need to change some, can anyone help me 🙂

charred tundra
#

I think if you provide a design mockup of what you want it to look like, that would help

clear girder
#

ok sec

mild cipher
#

but I don't think it does date and game

#

I could possibly put together a version that does, but I wanted to avoid redoing something that someone else has already well

mild crypt
#

@mild cipher it seems as though that via the link you provided and a subsequent link in it someone had asked the same thing and it looks like there is a way to do it via the examples. So I will be giving it a go this afternoon to see how it works and make any necessary changes to suit my needs but it looks like exactly what I am looking for. Thanks for the link as I had searched and searched and it never turned up that one

pure summit
#

Hello, I asked this question over in the helpdesk-twitch channel, but was referred here. Any help or guidance is greatly appreciated!
Trying to setup automated response to gifted subs and sub bombs with chat command using specific keywords from the Default Twitch message stating "SoAndSo is gifting X Tier X subs to Streamers Community! They've gifted a total of X in the channel!" (Appears in chat with the purple bar on the left). Will SE be able to pick up on these messages? Also, is there a way to get more specific and have a digit wildcard in the Command Aliases to be sure we catch the right message?

crystal loom
#

is there a varible for the bot commands to pull from a WebAPI

mild cipher
#

@pure summit pretty sure the messages from Twitch are system messages and don't count as regular chat messages, so they can't trigger commands, but you can always try

#

@crystal loom ${customapi.https://.......} will fetch and return a response, ideally with a Content-Type of text/plain

crystal loom
#

thanks

#

can you chose from the webAPI it outputs?

pure summit
#

ok, thanks @mild cipher . We currently have another bot running that responds with a message in chat, but I wanted to eliminate the dependency on that bot if possible. I will mess around with it.

mild cipher
#

@crystal loom can you elaborate? You can pass variables into the link of the customapi which can affect the response, but you'll need to handle that server-side

crystal loom
#

im trying to add a radio command and have it read the API from the radio where it only graps the song and artist then later on the amount of listeners but when it runs it shows "listeners":43,"now_playing_title":"Don't Stop Me Now","now_playing_artists":"Queen","now_playing_allinone":"Queen - Don't Stop Me Now"

mild cipher
#

That's JSON, so you'll need to parse and format that on your side

#

Are you just calling the endpoint directly?

crystal loom
#

yea

verbal geode
#

is there a command so i can do a count down in stream to let people join a game

mild cipher
#

@crystal loom won't work directly in the way you want it to I'm afraid, but DM me

#

@verbal geode there are no commands that can send more than one message consecutively

#

The best you can do is the streamelements countdown widget which will show a countdown on screen, but not in chat

pseudo siren
#

Hi SEheart
Please help me with a simply custom widget that displays {{user}} is banned when you delete a message.

primal elk
#

Okay, so the custom font is in now, but I need to fix it so the message reads "So and so subscribed!"
I have three variations for this. 1 plays for month 1 and 2, the second plays for at least 3 months, the last is 6 months onwards.

I need to know what to change in the HTML codeline so that it does that, but keeps the custom font and color.

#

update: It now says has subscribed, but it won't display the amount.

primal elk
#

Okay, I was told I could actually change the font so that it takes it off my PC even while custom CSS is on. How do I get this to work because I tried replacing the text space and URL stuff to the filepath on my PC

primal elk
#

Nevermind. I'm completely stupid and was just informed that I don't actually have to use custom HTML or CSS at all

cosmic moat
#

ok so I'm doing an alert and I'm using custom font but the the normal font is also there so its double font 😦

#

ok nvm I'm a dummy i got it lol

viral patrol
#

This was an interesting night. I am really happy that both of you guys figured it on your own! If you have any questions I will be more than happy to help you (but those hours you wrote I am usually asleep 😉 )

glossy vale
#

Question: I would like to do a command !calc XXX (Being a number value) ...... for output I would like it to Calculate 80% of the number and output Total Fine: XXX

So example:

!calc 1000

Chat Message-:- Total Fine: 800

I found an api to use... just cant get it to work... I get "Parsing error at position 24: Mismatched input list, missing end of inputs" for a response..

Api: https://twitch.center/customapi/math?expr=1000*0.8

^ That example would work

Command variable i tried: Total Fine: ${customapi.twitch.center/customapi/math?expr=${1}*0.8)

viral patrol
#

You closed that command with wrong bracket

#

It is now like: ${...)

#

I think that Total Fine: ${customapi.https://twitch.center/customapi/math?expr=${1}*0.8} should work

glossy vale
#

Wow i was sooo close.... Sorry for being a pepega

viral patrol
#

No problem mate!

lament ice
#

Quick Q: Do we have some kind of chat TTS widget that you can trigger with a command? Like !say Hello guys

#

And if not, is it hard to create something like this? Please @ me if you have an answer SEheart

potent field
#

Howdy! I was wondering whether OAuth is still beta access only, and if it is, how I can get access.

cunning rune
#

can anyone help? i'm trying to set up a Minecraft mod's config files that has SE support that would allow the mod to do stuff when certain events happen, like tips, follows, etc. the mod is using this old guide to determine activity type and providers. does anyone know what Facebook's activity types are called, as this guide isn't updated to reflect Facebook events?

https://developers.streamelements.com/endpoints/activities

wise basalt
#

@viral patrol ah that makes sense since Yea the script I was developing isn't running in the SE development view. Let me try that then

wise basalt
#

hmm

#

i see the messages coming through the ws network traffic but no events fired on socket.io client

#

welp nvm im dumb...

#

they are tagged as event:test so the listener binding for event doesnt work 👍 all good

viral patrol
#

@potent field DM Styler to get your client ID and secret

karmic wave
#

im in the process of porting my SLCB to StreamElements.. Would anyone be able to help me find solutions to commands and such

pulsar willow
#

@hushed hazel hey, someone in the dutch channel is asking about your credit roll widget, they have everything set up, but it doesnt seem to go further than the 'stream is ending, thank you for'

hushed hazel
#

@viral patrol can you take a look? I havent touched that in ages, i think you made some changes to the widget at some point, right?

viral patrol
#

Checking that now

pulsar willow
#

Thanks LX

viral patrol
#

That is totally strange. I just imported that overlay and it works. Maybe the streamer is trying that in offline mode?

pulsar willow
#

no he tried it will be online

#

while*

#

and all the followers etc were enabled

viral patrol
#

Logic behind that is: "Show X latest subs" where X is the number of subs during session and so on

pulsar willow
#

he did make some changes to it with names and the speed

#

yhea its showing fine for me as well, but not for him on stream

viral patrol
#

I have no clue in that case. I checked it on two accounts and it seems working correctly on both of them... But I have an idea.

#

OK. That idea was correct 😉

pulsar willow
viral patrol
#

Widget has been updated on widget-share channel. Readd it to account and it should work fine now

pulsar willow
#

thank you

potent field
#

@static wigeon Hi, I was told to dm you to get my client id and secret for oauth, but you don't accept dms

static wigeon
#

Sure thing, who referred you?

proper prism
#

Hey guys,

I bought the overlay which is stated to be compatible with Stream Elements:
https://nerdordie.com/product/crusader-stream-package/

The follower alert in Stream Elements doesn't show the name of the person who followed. It shows the names for subs/donations/hosts/whatever, but doesn't show for the follower.

It shows the follower name when the same alerts are added with streamlabs, I tried readding the alerts, add it to different account, but result is the same. In Stream Elements it doesn't show the followers name.

I wrote to Nerd or Die about this problem, and they said that this is Stream Elements issue.

Right now I have to use those alerts in stream labs instead of stream elements. I hope you can help to fix it.

viral patrol
#

So I could take a look into that

#

As I am pretty sure it is not StreamElements issue 😉

#

But I will do my best to fix that 😉

potent field
#

@static wigeon sorry for the late response, just got out of class. lx told me to dm you

static wigeon
#

no worries 👍

#

Can you give me a tl;dr of what you are trying to build?

potent field
#

So, I'm a moderator on a twitch stream that uses SE. The streamer tracks user watchtime with SE to determine their elligibility to join his viewer-only minecraft server. I want to build an interface that allows users to link their twitch, discord, and minecraft (potentially other) accounts together so the streamer can handle membership of his viewers more easily.

Sorry for the weird explanation, I'm not very good with words. Essentially, I want to build an all-in-one community manager for streamers using SE

proper prism
#

@viral patrol thank you, sent the link in dm

viral patrol
#

Just checked that and I have to say I am sorry for false message - It seems that it is issue on SE side. Forwarding that to some nice guys 😉

viral patrol
#

So if somebody is experiencing issues with follower alert using custom code with {name} in that code, this might not work for you at the moment, but issue is reported. You can do a workaround to that and use {name} value in custom field then that custom field should replace {name} within HTML code.

timber dirge
#

hello 🙂

#

I'd like to add your api/websocket to my sub-timer, but i can't find any documentation on how the result JSON for the Events looks like, or like to know if i can test alerts an look at the json in the console and if it is the same as for realalerts, thanks in advance 🙂

viral patrol
#

@timber dirge For WS information and JSON schema please take a look into pinned message in that channel.

timber dirge
#

Oh sry i didnt see that, thank you very much! 🙂

cunning rune
#

@viral patrol Luki's inquiry is almost the same as mine that i haven't recieved an answer on yet, since Minecraft mods deal with JSON. however, there isn't any documentation from the link i posted or the pinned messages in the channel that relates to Facebook events

viral patrol
#

Unfortunately I haven't played with Facebook yet. I don't know the structure of ws or custom widget event structure. I am sorry. I have to learn about that as FB is growing and I would love to forget 'i haven't played with it yet' phrase

misty mortar
#

was wondering if there were any docs for the streamelements store

indigo flume
#

@torpid drum - @mild cipher will be able to help :)

fresh vigil
#

Hey LX, I think it was you who gave me the code for a custom marquee event list. It was working great but over time, all of the events have been replaced with just hosts. Could you look at it to see if there's something that needs to be adjusted?

golden trout
#

Hey anyone know of a way to.. link two counters??
I have a counter that allows the person to "give" bacon, the !bacon command - it adds one to the bacon counter.
I have another command, !notbacon which is supposed to subtract a bacon. Currently they are two different counters - one counter counts the bacon up, and the other counts the bacon down... two different bacon counters.

Is there a way to link the two? or have the command like... read !bacon + or !bacon - ???

mild cipher
#

@golden trout your counter names are two different names which is the reason for the differing counts. Your !notbacon command needs to have the counter name changed from deaths to bacon

golden trout
#

hahahahhaaa ... I feel stupid

#

😄

#

ill go change it

spiral ocean
#

Hello everyone, I'm working on my first ever custom widget and I want when I have a new follower to access a url that's gonna change a LED color. The url works on it's own, I know how to trigger the action but I don't know how to access the external url from the widget. So far I've tried with window.open and window.location.

mild cipher
#

You can ping the URL with

const url = 'your_url_here';
fetch(`https://cors-anywhere.herokuapp.com/${url}`);

(assuming your url doesn't have SSL, if it does you can use it with fetch directly)

spiral ocean
#

Thanks anyway. Maybe I'm not triggering the event correctly, I'm gonna keep playing with it.

mild cipher
#

Feel free to shoot me a DM blobthumbsup

spiral ocean
#

you're faaar too kind but I don't wanna waste your time, also I like a challenge. You helped more than enough already. I'm gonna keep playing with it and I'll let you know if I can't figure it out 🖖

timber lark
#

Hi @viral patrol! I'm using your Gift Explosion Widget and I really love it! I use the train for gifted subs. Unfortunately it didn't trigger twice on stream. It triggered after replaying the alert though. Any idea what could be wrong?

viral patrol
#

Sometimes Twitch doesn't forward all subs in gifted event and it won't play until all events are received (every gifted person)

gilded thorn
#

Hey guys! How I can add !subs command?
to show ma actual sub count

vapid iron
#

${channel.subs} @gilded thorn

#

If you're referring to Twitch thinkingOHNO

wispy pagoda
#

Is there a "branding usage" guideline for graphical treatment? I'm working on an app right now that I want to provide clarity about my app being compatible with the Streamelements API, and I'd like to use the logo, but don't want to step on toes.

trail sequoia
#

Hi just a quick question. wanted to know what JavaScript method would I need to call on the data object to access the username colour on twitch chat? Heres what I have
window.addEventListener('onEventReceived', function (obj) {
if (obj.detail.listener !== "message") return;
let data = obj.detail.event.data;
if (data.text.startsWith("!") && hideCommands === "yes") return;
if (ignoredUsers.indexOf(data.nick) !== -1) return;
let message = attachEmotes(data);
let badges = "", badge;
for (let i = 0; i < data.badges.length; i++) {
badge = data.badges[i];
badges += <img alt="" src="${badge.url}" class="badge"> ;
}
let username = data.displayName;
const color = data.displayColor;
addEvent(username, badges, message, data.isAction, color);
});
const color is returning white all the time?
is the problem here or is the value getting overrided else where?

mild cipher
#

Is the colour in chat explicitly set? i.e. if you have two chat windows open and send a message the colour should be the same, if it isn't set the colour will appear different between the two windows- in which case displayColor will be an empty string

trail sequoia
#

ahhh okay...is there anyway to set all users that come in to a colour?

mild cipher
#

If you mean so that everyone is the same colour, you could just hardcode the color value to a specific hex

trail sequoia
#

no I am setting colours into a dictionary so when they join select a random colour save based on username into a dictionary and then when they join lookup and set colour

#

thats what I want to do anyway

#

I got the javascript end I just dont know the api calls

mild cipher
trail sequoia
#

I just read my message back and its horrible lol...so

#

1). User joins stream and chats

#

if first time user chats set a random colour into a dictionary else lookup the random colour and set accordingly.

mild cipher
trail sequoia
#

yeah saw that, looks like exactly what I need...Is there anyway to work on this locally instead of in the editor on streamelements?

#

I have all the code local but then have paste it over there to test

#

should I read the docs lol

mild cipher
#

You can set up a local simulated version of the overlay editor for dev purposes with this

trail sequoia
#

ohhhhh gold dust!!! thank you 😄

mild cipher
#

Thank @viral patrol, he put it together smile1

trail sequoia
#

@viral patrol thank you sir!!

#

right fyre I think I have picked your brains enough...time to finish said widget 😄

#

have good morning/evening where ever you are 😄

mild surge
#

Hey there guys, quick question about a custom widget I have in the works:

Is it possible to use the color of someone's Twitch username to affect a portion of the visual overlay of said widget?

For example, if my username color is "255, 0, 0", and then I type command "!example @mild surge", can the widget recognize my username color and change the color of the overlay to match at "255, 0, 0"?

mild cipher
#

There isn't an endpoint to retrieve someone's colour on the fly, it's only visible if someone's sent a message in chat, so you could effectively collect and track colours yourself - (e.g. if you did !example thefyrewire to use my username colour, but I haven't said anything, you have no way of knowing what my colour is. If I send a message, you can then see the colour and keep in memory to refer to later)

#

Once you have the colour, then yeah, you can do whatever with it

lament ice
#

Quick Q: Do we have some kind of chat TTS widget that you can trigger with a command? Like !say Hello guys.
And if not, is it hard to create something like this? Please @ me if you have an answer SEheart

mild cipher
#

It's possible, but not sure if it's allowed. The SE TTS endpoint is fairly highly rate-limited, so making it a public widget could open it up to request abuse, or at least, not sure it'd be able to handle that many concurrent users

lament ice
#

damn it 😦

mild surge
#

Alright, thanks @mild cipher. I'll see if I can make it work with that!

simple cobalt
#

hello all. I was told to try here.. I am super curious if Stream Elements will ever make their own guides

I recently figured out that OBS Studio, Stream Elements and others do respond to KDE connect.. a Linux thing. it takes a bit more tech knowledge than normal to accomplish

outer vessel
#

I have a quick question, How does one acquire an api key for oauth and such.

#

@mild cipher I noticed you had an oAuth role, didn't know it was in beta

mild cipher
#

@outer vessel if you get in contact with Styler (his DMs might be closed so I think you'll have to ping him here to start with) with more details about your application he can get you set up with a client id and secret blobthumbsup

outer vessel
#

@mild cipher alright, thanks for the info!

#

@static wigeon Hi, I was wondering what is required to acquire an oAuth key. I'm working on an app for a streamer that connects to a DMX light and they can set it up to change colors or specific color animations based how much is donated.

raw brook
#

Is there a way to code the Custom Widget to show an alert when a new viewer pops into the channel? I see commands and codes to show a viewer count or display stats for a particular viewer. I'm looking for something that notifies me when a new viewer hits the stream so I can welcome them, rather than me actively triggering some data

viral patrol
#

You can get data from decapi (viewercount) and if the fetched number is higher than previous one, play an alert informing you about that.

raw brook
#

ok, thanks!

viscid jay
#

Hi, I'm trying to figure out the best way to detect if a user has the required number of points to perform an action.

I have tried removing more points than a user has, e.g. I call https://api.streamelements.com/kappa/v2/points/channel/user/-100 when I know the user only has 90 points.

I would expect this to fail but instead it returns a 200 result with a message saying the 100 was removed.

Is there a way for me to query if the user has the required number of points and decrement them as a singular action?

viral patrol
#

GET /kappa/v2/points/:channel_id/:username/

#

No authorization needed

mild cipher
#

I agree that it would be nice if a request to remove points that a user doesn't have would return a 4XX so that the flow is simplified and reduces required calls overall

#

Especially when working with the points system, it would be necessary to fetch a user's points every time since they might have earned more through loyalty/minigames making tracking/caching hard

hot stump
#

just noticed for the first time twitch actually does use userids and not just usernames for identification : )
is it possible to access the userid with just a simple customapi command ? so far I've been using usernames, but they change too often

worldly mauve
#

a lot of it stems to how chat works. It's still mainly irc so you'll be using usernames to join not id numbers - hence why if someone changes their name gotta log bots in/out to capture the new name-- https://decapi.me/twitch/id/:user <-- replace :user with the user name to grab their id

#

@hot stump ^

next remnant
#

So, in the Alerts you can add variations, now you can set CSS on the DEFAULT alert, which will use

<div class="image-container">
    <img src="https://cdn.streamelements.com/static/alertbox/default.gif">
</div>

now my question is, how can I just make a layout with CSS and HTML so that it will pick the "image" as example or and text, from that what I type in the textboxes. I haven't looked at it with the F12 editor, maybe I find something but, probably not the source.

viral patrol
#

@next remnant use {image} instead of https://cdn.streamelements.com/static/alertbox/default.gif in paste above. And in place where's message, replace contents by {compiledMessage}. Take a look at Overlay Editor documentation in channel's description to get more info

next remnant
#

Thats what was inside the default CSS. Oh right, haven't seen that documentation. So I rename someImage to image to have it clearer, or image-input? Oh wait these are fields especially for Alert widgets. 🤔
Thanks for letting me know.
What happens to the things here https://github.com/StreamElements/api-docs in the pull request.

#

wait what if I used a video instead of an image it will just be there empty?

viral patrol
#

It replaces {image}/{video} with URL of asset

next remnant
#

so would I be able to detect using source= or something, to see if it's a video or an image to add "additional stuff" as example a different color

viral patrol
#

The best way is to try and fail few times like I did (but I failed more times). This will give you some information. If you know javascript, you can check if {video} is empty string. If so - it should be an image instead of html5 video.

viscid jay
#

@viral patrol okay thanks.

#

@mild cipher yes without this the number of points a user has could change between me querying the number they have and then deducting them when I think they have enough.

trail sequoia
#

Hi all really banging my head against the wall...I have created a custom widget that runs perfectly locally with some constants set in place for testing instead of grabbing the fields...Like I say all works great then when I copy and paste the code over into stream elements editor...it doesn't work...With no debugger present its starting to drive me crazy...I can get half of it running but when I try to append the html to the end of the div after it has had time to animate to its full size...it craps it and I dont get my second animation...stressing to say the least as I thought this would be the easy bit...All help appreciated!!!

green sierra
#

how would I go about differentiating from gifted subs/community gifts? whenever a sub is gifted (singular) both my standard sub alert and my gifted sub alert goes off. If it's more than 1 gifted sub then the standard alert plays an equal number of times as well as my gifted sub alert. Very annoying and frustrating. I appreciate your time and input!

charred tundra
#

@trail sequoia might not be able to help immediately but it will help if you share your code! JSFiddle is great for that

#

@green sierra are you talking about an existing widget or are you using something custom?

trail sequoia
#

gimme two seconds anne Ill do a little code dump

#

brb

#

its and awful lot of code let me make an arbitrary fiddle of bare minimum back later

green sierra
#

@charred tundra my gifted sub alert is a default widget playing a custom media file, and my standard sub alert is a custom widget playing a custom media file.

charred tundra
#

custom widget talk is best here, default twitch alerts are best discussed in #helpdesk-twitch 🙂

#

so I think also, if you share your code so people can have a look to see what's going on that helps

shut lantern
#

Hello, friends! I'm currently building a custom Hype boss like widget that is supposed to use SE's loyalty system. So, my question is, how do I access the loyalty system through code?

mild cipher
#

The API docs for the points endpoints are in the header of the channel. Custom widgets are supplied with the channel's apiKey that has read access for certain scopes, like points, but write access requires the channel's full JWT token, which should never be used in custom widgets since anyone who has access to your channel (like editors) will be able to see it and access/manipulate sensitive information on your channel

#

@shut lantern you could probably set up some server-side scripts to call, to talk to the points system so you can keep your token safe, but if you're building this for general use/other channels then that doesn't scale very well and it'd be better to ask to join the oauth2 beta which makes this a lot safer and easier

trail sequoia
trail sequoia
#

i'm losing it! So after spending a day and a half...I have re-wrote my custom chat overlay. To find that the animations(perfect locally) when on stream elements look terrible, I have random animations spawning but in Streamelements its the same animation that is no only incorrect in how it looks but also how its working...So confused...I cant debug, as locally its working flawlessly and there are no debug tools in the editor...Fyre hooked my up with a local version of your editor but it cannot deal with chat box overlays...sooo confused...is there a difference that I need to know about in regards to the sandbox editor on your website and my local machine?

trail sequoia
#

hmmm...is there a problem using setTimeout()?

#

I think im gonna be able to figure it out....just made my own debug tool...fingers crossed

broken coyote
#

Looks a lot like the one I made for her except animated bubbles. Why aren’t you just editing it in SE editor?

trail sequoia
#

I am

#

I think I found the problem

#

I dont like that there is no debug in the SE editor and I dont like the size of it...in the future I will use...Did you make one for her as well because I was told that she got let down by the person making it..

trail sequoia
#

DID IT....RUNNING AND WORKING!!! im so dumb lol.

broken coyote
#

she said it wasnt what she wanted

real dune
trail sequoia
#

Sorry to hear that @broken coyote

#

@real dune I love that cartoon :D...

broken coyote
#

LOL. no need to say sorry ol bubby. just rubs me raw to say she was "let down" considering i feel i made what she originally asked for

trail sequoia
#

looks exactly like what was asked for...She may not of been talking about you, it was an assumption. Im having a nightmare with it again lol the emojis are HUGE lmao

broken coyote
#

thats a eazy fix

#

alot of the NoD chats did that

trail sequoia
#

NoD ?

broken coyote
#

nerd or die

trail sequoia
#

ahh

broken coyote
#

thats what that chat is from

trail sequoia
#

ahhh

#

brb

#

give us a hint with these emojis then Boost 😄

#

nevermind got it

broken coyote
#
#log .emote {
  display: inline-block;
  margin-right: 0.2em;
  position: relative;
  height: 2em;
  vertical-align: middle;
  top: -0.1em;
}
#log .emote img {
  display: inline-block;
  height: 1em;
  opacity: 0;
}
#

all you had to do was ask

trail sequoia
#

😄 thanks 😄

digital glacier
#

Hello! Is there a way to receive feedback from streamelements when people follow/sub/tip/raid/etc..? trying to whiteboard a script that will listen for that and then trigger actions

mild cipher
#

@digital glacier depending on your needs you can either use the socket api (examples in the pinned messages) or a custom widget (docs in the channel header)

#

Saw that you want to just trigger a GET request. In that case the easiest method is an invisible custom widget. You can basically just take the widget, strip out all the HTML, CSS, JSON and reduce the JS to just the parts listening to the events (the event listeners). If you scan through the default code it'll become clearer

digital glacier
#

yep! all I need is for when events occur, to trigger a get request to different URLs for each type of event

mild cipher
digital glacier
#

HA, I didnt click into the header to see the other link, doh

#

I will dig into this

#

thank you!

#

youre a legend, dont let anyone tell you otherwise

digital glacier
#

@mild cipher does streamelements js have a preferred way to call api's? I am pretty new to coding and when I was making python scripts I get borked because I didnt realize the bot I was using couldnt recall the library I originally wanted to use

mild cipher
#

The easiest way is with the Fetch API. For a simple GET request that acts as a ping, you can simply do

fetch('https://www.example.com/');
#

If your endpoint that you're pinging doesn't have SSL, prepend the link with a call to cors-anywhere as a workaround

fetch('https://cors-anywhere.herokuapp.com/http://www.example.com/');
digital glacier
#

I am pinging a link on my local network

#
        fetch('https://www.example.com/');```
#

something like that?

mild cipher
#

I don't think you can ping localhost from the widget, but you can try. You'll probably need to run ngrok to expose your localhost as a publicly accessible address

digital glacier
#

OH right!

#

duh its not running on my system

mild cipher
#

But yeah, like that blobyes

digital glacier
#

hahaha thanks!

#

appreciate you.

stone panther
#

Any command wizard out there able to help me make a seppuku comand? In streamlabs it worked by just doing

/timeout $user 60```
But in SE it just puts both lines right after eachother and does basically nothing :/
viral patrol
#

It is not possible to have 2 responses to a single command

stone panther
#

So that command won't be possible with SE?

viral patrol
#

You can have just /timeout ${sender} 60

#

As ${user} could be abused (timeouting other people)

stone panther
#

Kinda defeats the purpose if there's no response from the bot

viral patrol
#

Samurais commited seppuku in silence, so nobody witnessed that. It was not a public suicide. So I think that just timeout should be fine 😉

cursive rampart
#

Hello friends! I ask to you a little help for a progress bar for donation goal. I found an example using html, css and JS. Here I write 50% "<div class="ldBar" data-value="50"></div>" but can you help me to update the number in real time? Thanks in advance! I am using this: https://loading.io/progress/

mild cipher
#

I did use that library a few months ago working on a circular goal to go around someone's profile picture, but I don't think I released it anywhere. One of the other widgets that I started was recreating the default goal widget with more customisation options, so maybe I'll combine the two at some point crazy_think

cursive rampart
#

Thanks for your answer. I will try now 🙂

viral patrol
sturdy yarrow
#

I'm trying to figure out if I can do a REST API call (with JSON body preferrably) using just the streamelements bot. I was told that it could maybe be done with custom overlay widgets, but I was wondering if it's also possible with the regular chat commands

#

also do overlays only work when they're loaded for the stream, or do they technically react 24/7?

mild cipher
#

@sturdy yarrow you can perform a GET request with the bot using the ${customapi.https://example.com} variable

#

And for your other question... if a tree falls in a forest and no one is around to hear it, does it make a sound? spinning_think

sturdy yarrow
#

It depends on if the tree's sound library is running forest-side or if it gets loaded in when a hiker goes for a walk.

mild cipher
#

In any case, the overlays run when they're loaded (i.e. in the overlay editor/as a browser tab/in OBS) but otherwise no

sturdy yarrow
#

Shame

mild cipher
#

What are you planning?

sturdy yarrow
#

A command that lets you verify your discord account on twitch

#

Discord API won't show user account connections, you can just lie if the command is on discord, and I wanted to do it with the least amount of resources possible.

Essentially you write a name and that gets posted in a discord channel

mild cipher
#

Well, I guess you could use the customapi command to hit a script with the sender's username (i.e. embedding ${sender} in the URL- you'd still have to ensure the link remains a secret so it can't be spoofed, and maybe do some validation like request headers), and feed that into your database/backend or whatever?

sturdy yarrow
#

Well, I'd need an API that uses the URL and not just JSON bodies for that. If nothing premade like that exists, that's fair. Setting that up myself would be too much effort tho

pulsar willow
#

Hello, about the viewer queue system, what does the !promote command do?

rugged rapids
#

It boosts a user to the top of the queue.

steady iron
trail sequoia
#

@steady iron is it for your chat or someone elses?

steady iron
#

it would be for the chat of the same Twitch account that is connected to Streamelements

trail sequoia
#

you send it over a socket to twitch

#

or you can request from the end point...the twitch api docs do my head in though...when I developed a chatbot for someone I got them to use the link above

steady iron
#

let me check

trail sequoia
#

I would def wait for one of these guys as there maybe a way using streamelements api...I just havent had the need yet

#

Hi Stream elements just a quick one...is there a way to send my custom chat widget to someone else that doesnt involve them copying and pasting the code?

steady iron
#

I got this token: oauth:xxxxxxxxxxxxxxxxxxxxxxxxx, and in the stramelements API I am doing this:

xhr.setRequestHeader("authorization", "oauth:xxxxxxxxxxxxxxxxxxxxxxxxxxxxx");

And getting "message":"Format is Authorization: Bearer [token]"}

rugged rapids
#

@trail sequoia With editor access to this account you can copy overlays to another accunt you got access to.

trail sequoia
#

ahhhh thanks Benno...If I make an account and give the person editor will they be able to copy over?

rugged rapids
#

yes. they can than copy the overlay to their own account.

trail sequoia
#

@steady iron us that format...hold on let me see if I can find where I connect...

#

Thanks Benno

#

Hi Rene, Just realized my connection is done via Python I am more than happy to send you the connection code? Sorry I can be more help

#

deleted that was def incorrect lol

steady iron
#

No worries, the token should be fine, the only thing to know is the format

mild cipher
#

The authorization for that endpoint is the SE JWT token, as the message would be coming from the SE bot. You need to go through oauth2 with SE to make that happen

#

Otherwise, it's possible to use another library like twitch.js with the token you already made, but I would be highly careful if you have the token plainly visible in the widget that other editors might be as to see, as anyone with access to it can use it to send messages as that account anywhere on Twitch

steady iron
#

Oh! So it is not twitch oauth token!

#

now the question would be: where do I get the SE JWT token?

high swallowBOT
#

You can find your JWT token on your account channels page ("Show Secrets" to reveal the token): https://streamelements.com/dashboard/account/channels
READ ME:
This is a private security token. Do NOT share this token here or other public places, only with a StreamElements staff member in private.

steady iron
#

Oh, silly me

steady iron
#

I now know where to get it, thanks to the Support bot 😄

trail sequoia
#

So anyone know how I go about using my own font in my custom widget?

#

can I include the file somewhere?

#

or does it need to be imported?

high swallowBOT
#

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

Custom Fonts

Steps:

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

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

trail sequoia
#

Its not a google font...

real dune
#

SE uses google fonts, you can try your own one, but it might not work

trail sequoia
#

Okay thanks tadpole

steady iron
#

Alright, so I got the JWT to be accepted, but now it tells me "statusCode":403,"error":"Forbidden","message":"No channel authorization found"

I see from the documentation of the API that it needs a "channel Id" in the path params, so I imagine this is missing as I havent indicated the channel anywhere, but I do not see how to add the path param for the channel ID

next remnant
#

Is there a function for the html, css, javascript editor for widgets, like for any of the alerts. Does onload work as example?

rugged rapids
#

Create a custom widget.

next remnant
#

I mean I'm trying to randomize something in the widget effect, it gets sent to the overlay site and then I'm not sure if it will apply changes, because the iframe is there but it is the same 🤔 and once sent it will modify that's why I'm wondering if onload would work so that each time the widget appears I thought that it would trigger onload if it's within the iframe 🤔 not sure

rugged rapids
#

There is an ```JS
window.addEventListener('onWidgetLoad', function (obj) {
//fancy stuff here
});

next remnant
#

and I can use that on the widget alert, the one that is for the alerts? It looks like it is for the parent window and not the widget itsself? 🤔

rugged rapids
#

Yes, this is for the parent windows afaik.
If you want to make the apperas yourslef, set the in and out animation to none and code them yourself.

next remnant
#

I coded an example, now I'm trying to think on how to trigger the randomizer
It has to be triggered when the popup appears but it has to be in the popup, the popup itsself in its javascript will contain the trigger and not the parented window.

rugged rapids
#

via JS you could add css classes to your elements and define these in the CSS.

#

you could randomize which class gets added.

next remnant
#

https://jsfiddle.net/d25kx6cj/5/ that's an example I used to answer a question on stackoverflow. Now, my only question is what would work to trigger that function that randomizes. I think setTimeout with 0 miliseconds would always work, not sure if it could freeze something. Because after that it gets sent to an iframe so I'm not sure how it would work. And it is not a Custom Widget it is a existing wiget with custom html, css and js

rugged rapids
next remnant
#

I'm just looking for something that would call the function where everything begins on appearance.

rugged rapids
#

that would be the event of the sub or whatever.

next remnant
#

window.onload works but issue is that

#

it's not the same

#

It is different on the overlay editor and on the overlay link itsself 🤔 yep I wonder how I can keep that sync seems to get loaded separately
onWidgetLoad didn't work though. setTimeout worked but both results are separate again, well yeah hm

rugged rapids
#

Sorry, I am not the right person to help you with this. Maybe another code guru has an idea on this. sorry.

mild cipher
#

I had a skim read but I'm still lost, what exactly are you attempting to do?

next remnant
#

I was trying to randomize the animation sequence, which worked right. I was able to call and do stuff with window.onload.

#

However, when things are randomized, that what is getting sent to the actual overlay is not the same as in the editor overlay, I mean not a big issue, buuut still 🤔 I mean it makes sense

mild cipher
#

If it's random then different instances of the overlay will all have different random results, they're not exact mirrors I'm afraid

next remnant
#

now the only thing I'm wondering. If there is random animations and stuff and you can randomize that an animation doesn't play but others do.
How do you affect the alert timer. Alerts have a set timer but when the animations and stuff are longer or shorter, it wouldn't be really bad to tell it to expire earlier or stay longer :)

mild cipher
#

Is this a custom widget?

next remnant
#

it's the follower widget for testing not custom. I want to stay on the alert widget and not custom one, otherwise I would need to remake the follower widget

rugged rapids
#

alertbox with custom css?

next remnant
#

yep

#

lemme try to extend the timer to 999 and tell it tooo hm well delete itsself the document or window wait that will not work because streamelements api is still stuck at timer 999 and will not play any other alert until the timer runs out Thonk

mild cipher
next remnant
#

How do fields work, like how does it know that it exists. Is there source code for that, because how can I access the field itsself with JS without using the field with {{ }} to see if I can modify it and make it exist in an alertbox.

mild cipher
#

if you do console.log(this) you can see the alertbox's data, but I don't think you can set anything from here

next remnant
#

is there a direct link though for the alert widget thanks for all help though

trail sequoia
#

anyone know if I can import third party libraries into stream elements...for example pixijs ?