Skip to content

Commit

Permalink
7TV Emotes 1.4.19
Browse files Browse the repository at this point in the history
* Added: Emote preview in chat when a new emote is added to the channel
  • Loading branch information
Lordmau5 committed Jan 17, 2024
1 parent c967c33 commit dcd341b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/7tv-emotes/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main",
"clips"
],
"version": "1.4.18",
"version": "1.4.19",
"short_name": "7TV",
"name": "7TV Emotes",
"author": "Melonify",
Expand All @@ -14,5 +14,5 @@
"website": "https://7tv.app",
"settings": "add_ons.7tv_emotes",
"created": "2021-07-12T23:18:04.000Z",
"updated": "2023-12-22T00:31:14.154Z"
"updated": "2024-01-17T19:52:28.900Z"
}
10 changes: 5 additions & 5 deletions src/7tv-emotes/modules/emotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,21 +261,21 @@ export default class Emotes extends FrankerFaceZ.utilities.module.Module {
}

if (completed) {
let message = `[7TV] ${body.actor.display_name} `;
let message = `${body.actor.display_name} `;
switch (action) {
case 'ADD': {
message += `added the emote '${emote.value.name}'`;
message += `added the emote ${emote.value.name}`;
break;
}
case 'REMOVE': {
message += `removed the emote '${emote.old_value.name}'`;
message += `removed the emote ${emote.old_value.name}`;
break;
}
case 'UPDATE': {
if (oldEmote?.name !== emote.value.name) {
message += `renamed the emote '${oldEmote.name}' to '${emote.value.name}'`;
message += `renamed the emote ${oldEmote.name} to ${emote.value.name}`;
} else {
message += `updated the emote '${emote.value.name}'`;
message += `updated the emote ${emote.value.name}`;
}
break;
}
Expand Down
10 changes: 7 additions & 3 deletions src/7tv-emotes/modules/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,14 @@ export default class Socket extends FrankerFaceZ.utilities.module.Module {
delete this._rooms[room.id];
}

addChatNotice(channel, message) {
addChatNotice(channel, message, tokenize = true) {
if (!this.settings.get('addon.seventv_emotes.update_messages')) return;

this.siteChat.addNotice(channel.login, message);
this.siteChat.addNotice(channel.login, {
message,
icon: new URL('https://cdn.frankerfacez.com/static/addons/7tv-emotes/logo.png'),
tokenize
});
}

onMessage({ op: opcode, d: _data }) {
Expand Down Expand Up @@ -296,7 +300,7 @@ export default class Socket extends FrankerFaceZ.utilities.module.Module {
this._active_channel_set = newSet.id;

this.emotes.updateChannelSet(channel, newSet.id);
this.addChatNotice(channel, `[7TV] ${body.actor.display_name} updated the active emote set to '${newSet.name}'`);
this.addChatNotice(channel, `${body.actor.display_name} updated the active emote set to ${newSet.name}`);
}

// TODO: Empty data / "updated" array when setting to "No Paint" or "No Badge"
Expand Down

0 comments on commit dcd341b

Please sign in to comment.