diff --git a/src/providers/twitch/TwitchMessageBuilder.cpp b/src/providers/twitch/TwitchMessageBuilder.cpp index 10ca6ba12..38595c70f 100644 --- a/src/providers/twitch/TwitchMessageBuilder.cpp +++ b/src/providers/twitch/TwitchMessageBuilder.cpp @@ -183,9 +183,18 @@ MessagePtr TwitchMessageBuilder::build() auto app = getApp(); const auto &phrases = app->ignores->phrases.getVector(); auto removeEmotesInRange = - [](int pos, int len, + [&message = this->originalMessage_](int pos, int len, std::vector> &twitchEmotes) mutable { + int emotePos = 0; + for(int i = 0; i < pos; ++i) { + ++emotePos; + if (message.at(i).isLowSurrogate()) { + --emotePos; + } + } + pos = emotePos; + auto it = std::partition(twitchEmotes.begin(), twitchEmotes.end(), [pos, len](const auto &item) {