diff --git a/lib/api/twitch_api.dart b/lib/api/twitch_api.dart index ed166071..97b48f23 100644 --- a/lib/api/twitch_api.dart +++ b/lib/api/twitch_api.dart @@ -44,7 +44,18 @@ class TwitchApi { final decoded = jsonDecode(response.body)['data'] as List; final emotes = decoded.map((emote) => EmoteTwitch.fromJson(emote)).toList(); - return emotes.map((emote) => Emote.fromTwitch(emote, EmoteType.twitchChannel)).toList(); + return emotes.map((emote) { + switch (emote.emoteType) { + case 'bitstier': + return Emote.fromTwitch(emote, EmoteType.twitchBits); + case 'follower': + return Emote.fromTwitch(emote, EmoteType.twitchFollower); + case 'subscriptions': + return Emote.fromTwitch(emote, EmoteType.twitchChannel); + default: + return Emote.fromTwitch(emote, EmoteType.twitchChannel); + } + }).toList(); } else { return Future.error('Failed to get Twitch channel emotes.'); } diff --git a/lib/models/emotes.dart b/lib/models/emotes.dart index dbb8a74f..5e4f24ef 100644 --- a/lib/models/emotes.dart +++ b/lib/models/emotes.dart @@ -181,7 +181,6 @@ class OwnerFFZ { } // * 7TV Emotes * - @JsonSerializable(createToJson: false) class Role7TV { final String id; @@ -310,6 +309,8 @@ class Emote { } enum EmoteType { + twitchBits, + twitchFollower, twitchSub, twitchGlobal, twitchUnlocked, diff --git a/lib/models/emotes.g.dart b/lib/models/emotes.g.dart index b685dc19..07e936f3 100644 --- a/lib/models/emotes.g.dart +++ b/lib/models/emotes.g.dart @@ -143,6 +143,8 @@ Map _$EmoteToJson(Emote instance) => { }; const _$EmoteTypeEnumMap = { + EmoteType.twitchBits: 'twitchBits', + EmoteType.twitchFollower: 'twitchFollower', EmoteType.twitchSub: 'twitchSub', EmoteType.twitchGlobal: 'twitchGlobal', EmoteType.twitchUnlocked: 'twitchUnlocked', diff --git a/lib/models/irc.dart b/lib/models/irc.dart index 38b52802..b944419a 100644 --- a/lib/models/irc.dart +++ b/lib/models/irc.dart @@ -522,7 +522,9 @@ class IRCMessage { required double height, }) { const emoteType = [ - 'Twitch (Sub)', + 'Twitch (Bits Tier)', + 'Twitch (Follower)', + 'Twitch (Subscriber)', 'Twitch (Global)', 'Twitch (Unlocked)', 'Twitch (Channel)', @@ -677,7 +679,7 @@ class IRCMessage { name: emoteWord, zeroWidth: false, url: 'https://static-cdn.jtvnw.net/emoticons/v2/$emoteId/default/dark/3.0', - type: EmoteType.bttvChannel, + type: EmoteType.twitchSub, ); } } diff --git a/lib/screens/channel/chat/emote_menu/emote_menu_panel.dart b/lib/screens/channel/chat/emote_menu/emote_menu_panel.dart index e06afe6b..88424081 100644 --- a/lib/screens/channel/chat/emote_menu/emote_menu_panel.dart +++ b/lib/screens/channel/chat/emote_menu/emote_menu_panel.dart @@ -65,7 +65,7 @@ class EmoteMenuPanel extends StatelessWidget { ], if (subEmotes.isNotEmpty) ...[ const SliverToBoxAdapter( - child: SectionHeader('Subbed Emotes'), + child: SectionHeader('Subscribed Emotes'), ), EmoteMenuSection( assetsStore: assetsStore,