SevenTV / EventAPI

A service which provides live updates for various resources implementing the Server-Sent Events and WebSocket specs
Other
15 stars 6 forks source link

Listening to user emotes #69

Closed anKordii closed 2 years ago

anKordii commented 2 years ago

Hi, I'm trying to subscribe to the emote_set.update however I don't get any message back, if I'm subscribed or any updates. Probably I'm just dumb and I'm missing something.

Here is my code:

import WebSocket from 'ws';

const ws = new WebSocket('wss://events.7tv.io/v3');

const ws_sub_xanax = {
    op: 35,
    d: {
        type: "emote_set.update",
        condition: {
            object_id: "62f7c07fe760964fc08e2be8"
        }
    }
}

ws.on('open', function open() {
    ws.send(JSON.stringify(ws_sub_xanax))
});

ws.on('message', function message(data) {
  console.log('received: %s', data);
});
AnatoleAM commented 2 years ago

The object_id does not seem to resolve to an Emote Set, but rather to a user. Since object_id is an explicit object match, user IDs aren't supported on an emote_set.* event scope

anKordii commented 2 years ago

Then, how can i subscribe to someone's channel for emotes sets updates?

AnatoleAM commented 2 years ago

For now you can use /v1 until v3 is fully documented for public consumption.

anKordii commented 2 years ago

Okay, Thank you so much for help.