Generate userstate.emotes (or emotes-raw) for self messages
See original GitHub issueWhen 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:
- Created 7 years ago
- Comments:9 (9 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Added in v1.0.1 and v1.1.0
Thanks 😄
👍