From 2d420a17acf58f2028f0e8d1b958b87eeaff0780 Mon Sep 17 00:00:00 2001 From: SirStendec Date: Fri, 2 Aug 2024 17:47:41 -0400 Subject: [PATCH] 4.73.0 * Added: Setting to hide a certain promotion that keeps reappearing, even when you use the "Don't show again" option. --- package.json | 2 +- .../twitch-twilight/modules/chat/index.js | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e3ca5b9e..0830b4f6 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.72.4", + "version": "4.73.0", "description": "FrankerFaceZ is a Twitch enhancement suite.", "private": true, "license": "Apache-2.0", diff --git a/src/sites/twitch-twilight/modules/chat/index.js b/src/sites/twitch-twilight/modules/chat/index.js index d0212712..e1146303 100644 --- a/src/sites/twitch-twilight/modules/chat/index.js +++ b/src/sites/twitch-twilight/modules/chat/index.js @@ -461,6 +461,16 @@ export default class ChatHook extends Module { } }); + this.settings.add('chat.banners.hide-appleplus', { + default: false, + ui: { + path: 'Chat > Appearance >> Community', + title: 'Hide the drop notification for getting AppleTV+ when you buy a subscription.', + component: 'setting-check-box', + description: '**Note:** Normally, I wouldn\'t add something that directly affects an advertisement like this, but Twitch broke the "Don\'t show again" checkbox, so it\'s up to us to fix it.' + } + }); + this.settings.add('chat.banners.hype-train', { default: true, ui: { @@ -1061,6 +1071,7 @@ export default class ChatHook extends Module { this.chat.context.on('changed:chat.banners.prediction', this.cleanHighlights, this); this.chat.context.on('changed:chat.banners.drops', this.cleanHighlights, this); this.chat.context.on('changed:chat.banners.pinned-message', this.cleanHighlights, this); + this.chat.context.on('changed:chat.banners.hide-appleplus', this.cleanHighlights, this); this.chat.context.on('changed:chat.disable-handling', this.updateDisableHandling, this); @@ -1765,6 +1776,18 @@ export default class ChatHook extends Module { id: entry.id }); } + + if (type === 'mw-drop-available' && + entry.event.detailsURL === 'https://blog.twitch.tv/2024/07/26/sub-and-get-apple-tv/' && + this.chat.context.get('chat.banners.hide-appleplus') + ) { + this.log.info('Removing community highlight: ', type, '#', entry.id); + this.community_dispatch({ + type: 'remove-highlight', + id: entry.id + }); + } + } }