diff --git a/src/Nullinside.Api.TwitchBot.Tests/ChatRules/BestCheapViewersTests.cs b/src/Nullinside.Api.TwitchBot.Tests/ChatRules/BestCheapViewersTests.cs index 88007ed..40141a0 100644 --- a/src/Nullinside.Api.TwitchBot.Tests/ChatRules/BestCheapViewersTests.cs +++ b/src/Nullinside.Api.TwitchBot.Tests/ChatRules/BestCheapViewersTests.cs @@ -15,6 +15,8 @@ public class BestCheapViewersTests : AChatRuleUnitTestBase { /// /// The string that should fail. [Test] + [TestCase("C\u032dheap viewe\u034crs on\u0306 vwrpro.ru @8v2JcQFL")] + [TestCase("Ch\u031ae\u0345ap viewers on *** @STGPMoLg")] [TestCase("Best\u036e vie\u0350wers \u0337on ***")] [TestCase("Best viewers on ***")] [TestCase("Best viewers on ***")] diff --git a/src/Nullinside.Api.TwitchBot.Tests/ChatRules/DoghypeTests.cs b/src/Nullinside.Api.TwitchBot.Tests/ChatRules/DoghypeTests.cs index e1e71ce..aa484df 100644 --- a/src/Nullinside.Api.TwitchBot.Tests/ChatRules/DoghypeTests.cs +++ b/src/Nullinside.Api.TwitchBot.Tests/ChatRules/DoghypeTests.cs @@ -15,6 +15,7 @@ public class DogehypeTests : AChatRuleUnitTestBase { /// /// The string that should fail. [Test] + [TestCase("Visit dogehype dot com today and effortlessly boost your Twitch rankings! @opAzPMVt")] [TestCase("Visit dogehype dot com and watch your channel grow today! @5MGxTnYl")] [TestCase("Visit dogehype dot com today and climb the Twitch rankings with ease! Whether you're just starting out or looking to take your stream to the next level, DogeHype has the tools you need to succeed. @gqznceDC")] [TestCase("Visit dogehype .biz com today and climb the Twitch rankings with ease! Whether you're just starting out or looking to take your stream to the next level, DogeHype has the tools you need to succeed. @Axxq7ntz")] diff --git a/src/Nullinside.Api.TwitchBot/ChatRules/BestCheapViewers.cs b/src/Nullinside.Api.TwitchBot/ChatRules/BestCheapViewers.cs index 5af5588..a3c8c27 100644 --- a/src/Nullinside.Api.TwitchBot/ChatRules/BestCheapViewers.cs +++ b/src/Nullinside.Api.TwitchBot/ChatRules/BestCheapViewers.cs @@ -47,7 +47,7 @@ public override async Task Handle(string channelId, ITwitchApiProxy botPro int offset = 0; for (int i = 0; i < expected.Length; i++) { // If this is a normal character it should be in the correct position. - if (normalized[i + offset] == expected[i]) { + if (i + offset < normalized.Length && normalized[i + offset] == expected[i]) { ++matches; } // If this is an accent mark then the next character should match and the whole string we're evalutating