Skip to content

Commit

Permalink
parsing fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MahdiBM committed Sep 16, 2022
1 parent 282d64d commit 391c227
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/TwitchIRC/IncomingMessage/Emote.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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])),
Expand Down

0 comments on commit 391c227

Please sign in to comment.