From 391c2274c229b0741ce7a94d865a7b0a38a80197 Mon Sep 17 00:00:00 2001 From: Mahdi Bahrami Date: Sat, 17 Sep 2022 04:04:13 +0430 Subject: [PATCH] parsing fix --- Sources/TwitchIRC/IncomingMessage/Emote.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/TwitchIRC/IncomingMessage/Emote.swift b/Sources/TwitchIRC/IncomingMessage/Emote.swift index 621f852..eae2c0d 100644 --- a/Sources/TwitchIRC/IncomingMessage/Emote.swift +++ b/Sources/TwitchIRC/IncomingMessage/Emote.swift @@ -31,13 +31,13 @@ public struct Emote { let message = message.unicodeScalars var parsed = [Emote]() - for emotes in message.split(separator: "/") { + for emotes in emoteString.split(separator: "/") { let split = emotes.split(separator: ":") guard split.count == 2 else { continue } let id = String(split[0]) let isAnimated = id.hasPrefix("emotesv2_") for rangeString in split[1].split(separator: ",") { - let ranges = rangeString.split(separator: ":") + let ranges = rangeString.split(separator: "-") guard ranges.count == 2, let lowerBound = Int(String(ranges[0])), let upperBound = Int(String(ranges[1])),