Code Monkey home page Code Monkey logo

widgets's Introduction

StreamElements

widgets's People

Contributors

aaronhauth avatar adeithe avatar adrianmgg avatar commanderroot avatar diellan avatar diyachan avatar interfacegui avatar justlx avatar lieldulev avatar logicalsoiutions avatar pjonp avatar ramsteream avatar s-koell avatar sertaykabuk avatar styler avatar theca11 avatar thefyrewire avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

widgets's Issues

[BUG/INCOMPLETE DOCS] "event" listener (and others) missing in skippable list

Issue details
There a number of events received by the onEventReceived listener that don't cause the widget to be added to the SE queue, and thus that shouldn't trigger a call to SE_API.resumeQueue(). These events are referred to as skippable in the documentation/example widgets, and defined with this array:
let skippable=["bot:counter","event:test","event:skip","message","kvstore:update"];

However, this array is missing a critical type: "event". "event" is the production equivalent of the dev/test one "event:test": any real event received from the corresponding platform (e.g. Twitch) is first received with listener: event, which doesn't add widgets to the queue, and then the corresponding underlying event is broadcasted (e.g. subscriber-latest), which does add widgets to the queue. Therefore, by not having "event" in the skippable list, queueing fails in production environments under certain scenarios, even though everything seems fine in the editor.

Other listeners are also missing in the array: "delete-message","delete-messages","alertService:toggleSound". The delete ones are probably the most impactful ones, as moderating chat messages is a frequent task that can unexpectedly interfere with widgets.

How to reproduce (for free!)

  1. Create a new overlay. Add the Gift Bomb widget of this repo, and a store redemptions widget
  2. Emulate a community gift to trigger the gift bomb widget, and inmediately emulate an item redemption. The item redemption alert will not be displayed until the gift bomb train has ended, as it's properly queued (the redemption is sent as "event:test"). This is the expected behaviour
  3. Create a loyalty store item for testing, of type perk and cost 0 points. Now, emulate a community gift and right after redeem yourself the store item. The item redemption alert will be displayed while the gift bomb alert is still playing, because this widget has been incorrectly removed from the queue when receiving the "event" event of the redemption

What is affected by the issue

  • Documentation (PR #29)
  • Certain widgets published in this repo and Streamelements itself: Gift Bomb/Season of Subgiving & Wheel of Fortune
  • Potentially other widgets shared in the Discord. Since it seems no one has noticed this for a long time, and given it's a potentially breaking issue for some widgets, it might be a good thing to make some announcement for the devs

Channel Points event type for Custom Widget

Hi, I made my own chat widget and would like to display any channel point redemptions in that widget but the event listener doesn't get any channel point events. Is this possible to add? Thanks!

Idea: recent improvement (Widget)

Hi there,

I was trying working to a new Credit Widget.
I wondered if it is possible to add the obj.detail.recents some new type of events such as host and/or raid, to also have these events (and the users to thank) in the credit.

Thank you very much in advance.

Twitch cheer event not being received as cheer-latest

Hi, while creating a new custom widget that should detect when an user send bits in chat the documentation on CustomCode.md says that a new cheer event should be received on obj.detail.listener as cheer-latest. However when I test it what I'm actually receiving during the cheer event on obj.detail.listener is event.

What I ended up doing in my custom widget to identify a new cheer was taking the cheer event from obj.detail.event:
if (obj.detail.event.type == 'cheer') {
But in the documentation the type property doesn't even exists, is the documentation accurate and updated?

Custom Code docs accurate for Facebook?

Hello,

I am currently trying to implement a custom widget according to the docs at https://github.com/StreamElements/widgets/blob/master/CustomCode.md.

So far accessing data in onSessionUpdate worked fine, e.g.

window.addEventListener('onSessionUpdate', function (obj) {
    obj.detail.session["subscriber-total"].count; // this is the number of Twitch subscribers
});

However, documented Facebook stats do not work that well

window.addEventListener('onSessionUpdate', function (obj) {
    obj.detail.session["supporter-monthl"]; // this is null or undefined
    obj.detail.session["supporter-monthl"].count; // consequently getting the count does not work
});

Anything I am doing wrong on my end? Is the documentation accurate?

As an aside, double-checking the docs I also noticed that both Twitch and Facebook followers are documented as

data["follower-month"]["count"] // Twitch
data["follower-month"]["count"] // Facebook

Is it at all possible counting stats for both services in the same overlay? What I am looking for is a widget that provides an aggregate score across streaming services.

Modify persistent DATA of the widget from JS

Hello,
I'm actualy writing a widget i want to be customisable from Twitch chat with commands. Everything works fine (command catches, persmissions,...)
But i'm facing a problem.
I didn't find a way to modify widget fields data from JS (DATA tab from JS tab in editor)
Exemple of what i'm trying to do:

  • In Twitch chat a command: !!goal max 1500
  • Catch the command
  • Set the field value stored in DATA to this value

I know JS doesn't support passing parameters by ref, so modify "obj" received will change nothing, am i right ? Each time i'll reload widget, previous data stored in DATA will be back.
Is there a way to bypass my problem ?
Thx !

ChatPoll Widget not Working

Hi,

Have been trying to setup the Chat Poll in StreamElements, but nothing happens when activating the poll in chat - could someone please help me with this issue ? thanks

onWidgetLoad and onSessionUpdate data schemas do not match.

The documentation for onSessionUpdate says that the schema for the data that comes through for a session on onSessionUpdate matches the data that comes through on onWidgetLoad. See here: https://github.com/StreamElements/widgets/blob/master/CustomCode.md#on-session-update

However, upon attempting to use subscriber-points (along with various other subscriber-specific properties), the data does not match.

For example:

  • onWidgetLoad session data has subscriber-points with a value like { amount: 1 }
  • onSessionUpdate session data has subscriber-points with a value that represents the latest subscriber, such as { type: "subscriber", name: "Joscelin", ... }

Idea for chat widget

Hey there,

I'm missing a specific funktion on the chat widget. Assuming my viewers have written 4 messages. If the oldest message fades out after let's say 30 seconds, I want the newer messages to move up. Would that be possible?

Expose events related to activity feed buttons

Activity feed allows to pause/resume, skip, mute and replay alerts by pressing dedicated buttons which seem to work great when using provided widgets.

But custom ones don't seem to get access to those features. Correct me if I'm wrong but I tried to take a look at the code and WebSocket events only seem to broadcast some internal Angular events.

I think it would be a great addition to expose events related to activity feed buttons (plus initial state, maybe as a new property attached to the onWidgetLoad event data?) so that custom widgets can react accordingly.

Thanks :)

widget-button value on obj.detail.listener does not exist

The user thekillgfx found the widget documentation is wrong where it shows the widget-button value here:
https://dev.streamelements.com/docs/widgets/6707a030af0b9-custom-widget-events#on-event

Documentation says the value can be found in obj.detail.listener, but it is actually found in obj.detail.event.listener, which is correctly shown in the code example:
https://dev.streamelements.com/docs/widgets/6707a030af0b9-custom-widget-events#button-click

My suggestion: Just remove the widget-button line from obj.detail.listener docuementation as you already have a working example of it on the same page.

CustomCode.md documentation lacks

CustomEvent.type: redemption and CustomEvent.type: perk are not mentioned into the CustomCode.md documentation that's an heavy lack since a lot of creative and helpful widget could be developed thanks to Stream Store items redemption integration.

Updates will follow - I may provide a PR that include their documentation. Any help or contribution is welcomed!

AlertboxTextFit does not display text when live playing animation

When I emulate the animation from my machine it works, but when I replay a previous event (follower event) it does not display the text, which at the end becomes a live issue when streaming from Twitch. Is there any workaround to this?

Expected result Result
image image

Idea: Reminder!

Actually its pretty simple, but idk why there is nothing like this out there...
We all know it from Youtube. Simple Messages that slide in from the left or right and remind you to follow/subscribe.
Why isnt there any widgets like this out there?

Events List Badges

The badges for the events list doesn't seems to work only tips and follow work.

TextArea field

Hey it would be great to have a textarea field for the custom widgets, thanks πŸ™Œ

[BUG] Template string for AlertBox image is always the default

I am using the {image} template string to access alert box image.

I have set the image:
image
I have checked the HTTP request after selecting the image and it is properly uploaded to SE.

But the value of {image} returned is always regardless if the image is set or not.
https://cdn.streamelements.com/static/alertbox/ALERT_STARS_converted.webm

Every Follow = $0.10 to Charity Widget Counter

Looking to make a widget to do just that, Every Follow = $0.10 to Charity Widget Counter.
Is that even possible?

Example:
Daily Widget: 15 Follows = $1.50
Total Monthly: 200 Follows = $20.00

Getting started guide

Can you put a getting started guide in the markdown file? Im not really sure how to test what i wrote. Or how to import the widget i made into stream elements.

onSessionUpdate wont load donation name

Hi,

I am building a widget but i getting something not right. With this code everything is working and getting updated except for one value and thats the name of the "tip-session-top-donation". Everything loads fine with the "onWidgetLoad" but when i send a simulation donation i get the text "tip-session-top-donation" as name, the amount is updating fine.

Does somebody know what i do wrong?

window.addEventListener('onWidgetLoad', function (obj) {
    let data = obj["detail"]["session"]["data"];

    $("#top-dono .name").text(data["tip-session-top-donation"]["name"]);
    $("#top-dono .amount").text("€" + data["tip-session-top-donation"]["amount"]);
    $("#sub .name").text(data["subscriber-latest"]["name"]);
});

window.addEventListener('onSessionUpdate', function (obj) {
    const data = obj.detail.session;

    $("#top-dono .name").text(data["tip-session-top-donation"]["name"]);
    $("#top-dono .amount").text("€" + data["tip-session-top-donation"]["amount"]);
    $("#sub .name").text(data["subscriber-latest"]["name"]);

    updateEvent(data);
});

Expose provider name

Hello

I would like to access the provider name (twitch, youtube, …) and found out that this information is stored in the AngularJS code of the parent frame but don’t seem to be exposed to the custom code one. Or maybe it is somehow? Only the provider ID seems to be available but I sadly can’t do much with it.

Thanks 😊

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.