question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generate userstate.emotes (or emotes-raw) for self messages

See original GitHub issue

When listening to https://docs.tmijs.org/v1.0.0/Events.html#chat the userstate object won’t contain any emotes for self messages.

Today we have the technology to make it happen! I wanted to make a PR but I’m too newb to figure out where things are in the codebase…

Here’s the unoptimized function I’m using to generate them, if you need inspiration:

function generateEmotesProperty(message, twitchEmotes) {
  const sets = twitchEmotes.emoticon_sets;
  const emotes = {};
  Object.keys(sets).forEach(setId => {
    sets[setId].forEach(emote => {
      message.replace(new RegExp(emote.code, 'g'), (match, index) => {
        const start = index;
        const end = index + match.length - 1;
        emotes[emote.id] = emotes[emote.id] || [];
        emotes[emote.id].push(start + '-' + end);
        return match;
      });
    });
  });
  return emotes;
}

twitchEmotes being the data from this endpoint using the current user’s emote sets.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Schmoopiiecommented, Jun 28, 2016

Added in v1.0.1 and v1.1.0

Thanks 😄

0reactions
Schmoopiiecommented, Jun 26, 2016

👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

React integration | Docs
This JavaScript file will create the class App containing a TinyMCE editor configured to replicate the example on the Basic example page. Provide...
Read more >
Sendbird chat customization in React - Blog
The implementation here is simple, but the chat itself is quite advanced: Message threading, channel list, typing indicator, emoticons reactions ...
Read more >
Create a PowerShell activity
Create a custom PowerShell activity return data to a workflow from a host using Microsoft ... Legacy: Send emoticons in legacy chat messages...
Read more >
How to send whatsapp messages from google script
We provide an online generator for Fake WhatsApp Chat Messages. PingMe is a command line tool for sending messages or alerts from Linux,...
Read more >
Best State To Use For Fake Id - 1eurokactl.com
Best State To Use For Fake Id Best State To Use For Fake IdUsing your real credit card information can be dangerous generating...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found