Update QuoteRepository.cs
Add quote search by keyword and text
This commit is contained in:
parent
283fc2c216
commit
921f3a6d6c
@ -23,5 +23,11 @@ namespace NadekoBot.Services.Database.Repositories.Impl
|
|||||||
var rng = new NadekoRandom();
|
var rng = new NadekoRandom();
|
||||||
return _set.Where(q => q.GuildId == guildId && q.Keyword == keyword).OrderBy(q => rng.Next()).FirstOrDefaultAsync();
|
return _set.Where(q => q.GuildId == guildId && q.Keyword == keyword).OrderBy(q => rng.Next()).FirstOrDefaultAsync();
|
||||||
}
|
}
|
||||||
|
public Task<Quote> SearchQuoteKeywordTextAsync(ulong guildId, string keyword, string text)
|
||||||
|
{
|
||||||
|
|
||||||
|
var rngk = new NadekoRandom();
|
||||||
|
return _set.Where(q => q.Text.Contains(text) && q.GuildId == guildId && q.Keyword == keyword).OrderBy(q => rngk.Next()).FirstOrDefaultAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user