diff --git a/src/providers/twitch/TwitchMessageBuilder.cpp b/src/providers/twitch/TwitchMessageBuilder.cpp index 102d570e0..a79cdbd63 100644 --- a/src/providers/twitch/TwitchMessageBuilder.cpp +++ b/src/providers/twitch/TwitchMessageBuilder.cpp @@ -355,7 +355,7 @@ void TwitchMessageBuilder::addWords( auto i = int(); auto currentTwitchEmote = twitchEmotes.begin(); - for (const auto &word : words) + for (auto word : words) { // check if it's a twitch emote twitch emote while (currentTwitchEmote != twitchEmotes.end() && @@ -376,9 +376,19 @@ void TwitchMessageBuilder::addWords( MessageElementFlag::TwitchEmote); i += word.length() + 1; + + int len = std::get<2>(*currentTwitchEmote).string.length(); currentTwitchEmote++; - continue; + if (len < word.length()) + { + word = word.mid(len); + this->message().elements.back()->setTrailingSpace(false); + } + else + { + continue; + } } // split words