diff --git a/src/NadekoBot/Modules/Utility/Commands/QuoteCommands.cs b/src/NadekoBot/Modules/Utility/Commands/QuoteCommands.cs index cb4eb654..41ce9aa8 100644 --- a/src/NadekoBot/Modules/Utility/Commands/QuoteCommands.cs +++ b/src/NadekoBot/Modules/Utility/Commands/QuoteCommands.cs @@ -27,7 +27,7 @@ namespace NadekoBot.Modules.Utility IEnumerable quotes; using (var uow = DbHandler.UnitOfWork()) { - quotes = uow.Quotes.GetGroup(page * 16, 16); + quotes = uow.Quotes.GetGroup(channel.Guild.Id, page * 16, 16); } if (quotes.Any()) diff --git a/src/NadekoBot/Services/Database/Repositories/IQuoteRepository.cs b/src/NadekoBot/Services/Database/Repositories/IQuoteRepository.cs index a3a92efd..e3ca6ec1 100644 --- a/src/NadekoBot/Services/Database/Repositories/IQuoteRepository.cs +++ b/src/NadekoBot/Services/Database/Repositories/IQuoteRepository.cs @@ -8,6 +8,6 @@ namespace NadekoBot.Services.Database.Repositories { IEnumerable GetAllQuotesByKeyword(ulong guildId, string keyword); Task GetRandomQuoteByKeywordAsync(ulong guildId, string keyword); - IEnumerable GetGroup(int skip, int take); + IEnumerable GetGroup(ulong guildId, int skip, int take); } } diff --git a/src/NadekoBot/Services/Database/Repositories/Impl/QuoteRepository.cs b/src/NadekoBot/Services/Database/Repositories/Impl/QuoteRepository.cs index df8bddb6..22c6e5c9 100644 --- a/src/NadekoBot/Services/Database/Repositories/Impl/QuoteRepository.cs +++ b/src/NadekoBot/Services/Database/Repositories/Impl/QuoteRepository.cs @@ -15,8 +15,8 @@ namespace NadekoBot.Services.Database.Repositories.Impl public IEnumerable GetAllQuotesByKeyword(ulong guildId, string keyword) => _set.Where(q => q.GuildId == guildId && q.Keyword == keyword); - public IEnumerable GetGroup(int skip, int take) => - _set.OrderBy(q => q.Keyword).Skip(skip).Take(take).ToList(); + public IEnumerable GetGroup(ulong guildId, int skip, int take) => + _set.Where(q=>q.GuildId == guildId).OrderBy(q => q.Keyword).Skip(skip).Take(take).ToList(); public Task GetRandomQuoteByKeywordAsync(ulong guildId, string keyword) {