diff --git a/src/NadekoBot/Services/Database/Repositories/Impl/QuoteRepository.cs b/src/NadekoBot/Services/Database/Repositories/Impl/QuoteRepository.cs index be9db36d..a7036dff 100644 --- a/src/NadekoBot/Services/Database/Repositories/Impl/QuoteRepository.cs +++ b/src/NadekoBot/Services/Database/Repositories/Impl/QuoteRepository.cs @@ -1,4 +1,5 @@ -using NadekoBot.Services.Database.Models; +using NadekoBot.Services.Database.Models; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -26,9 +27,7 @@ namespace NadekoBot.Services.Database.Repositories.Impl public Task SearchQuoteKeywordTextAsync(ulong guildId, string keyword, string text) { var rngk = new NadekoRandom(); - string lowertext = text.ToLowerInvariant(); - string uppertext = text.ToUpperInvariant(); - return _set.Where(q => (q.Text.Contains(text) | q.Text.Contains(lowertext) | q.Text.Contains(uppertext)) & (q.GuildId == guildId && q.Keyword == keyword)).OrderBy(q => rngk.Next()).FirstOrDefaultAsync(); + return _set.Where(q => q.Text.IndexOf(text, StringComparison.OrdinalIgnoreCase) >=0 && q.GuildId == guildId && q.Keyword == keyword).OrderBy(q => rngk.Next()).FirstOrDefaultAsync(); } } }