Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate 01/15/15 Twitch changes #72

Closed
cletusc opened this issue Jan 16, 2015 · 4 comments
Closed

Investigate 01/15/15 Twitch changes #72

cletusc opened this issue Jan 16, 2015 · 4 comments
Assignees

Comments

@cletusc
Copy link
Owner

cletusc commented Jan 16, 2015

Reports of the emote menu not working have hit everywhere. Need to find out what Twitch changed that broke the addon.

This is very high priority--I am working on it!

Cross references:
night/betterttv#160
https://community.nightdev.com/t/chat-cant-be-read/2785/8?u=cletusc

@cletusc cletusc self-assigned this Jan 16, 2015
cletusc added a commit that referenced this issue Jan 17, 2015
@cletusc
Copy link
Owner Author

cletusc commented Jan 17, 2015

This is partially fixed; it works, but only for native emotes; will have to implement a special API for 3rd parties to add emotes. There is plenty to rework on this still, but it's at least part of the way there.

cletusc added a commit that referenced this issue Jan 18, 2015
@cletusc
Copy link
Owner Author

cletusc commented Jan 18, 2015

Docs for the emotes API still needs to be done. emoteMenu.registerEmoteGetter(name, fn) where name is your addon name, and fn is a function that returns an array of usable emote objects in this format:

[
    {
        text: 'text-to-put-in-chat-on-click',
        channel: 'the channel it should be grouped under',
        url: 'theEmote.jpg'
    },
    // ...
]

Some sample code for BetterTTV I made shows the basic usage:

function getter() {
  var emotes = [];
  var raw = BetterTTV.chat.store.bttvEmotes;
  Object.keys(raw).forEach(function (key) {
    var emote = raw[key];
    emote.text = emote.regex;
    // If not all emotes are usable, do that check here and
    // only push if the emote can actually be used.
    // ...
    emotes.push(emote);
  });
  return emotes;
}

emoteMenu.registerEmoteGetter('BetterTTV', getter);

@cletusc
Copy link
Owner Author

cletusc commented Jan 19, 2015

Part of the sorting and how the emotes are being handed should be reworked to make it more clear. All this logic should be thrown in src/modules/emotes.js somehow. The createEmote should also be reworked to be more rugged. For some reason, getters specifying a channel doesn't actually group those channels if a sub exists.

Get the emote handling reworked, then the createEmote can be reworked, possibly in a src/modules/ui.js or something.

@cletusc
Copy link
Owner Author

cletusc commented Jun 29, 2015

8641b60 is what did the major rework on the emote portion. The UI will be handled separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant