diff --git a/src/NadekoBot/Modules/Administration/Commands/UserPunishCommands.cs b/src/NadekoBot/Modules/Administration/Commands/UserPunishCommands.cs index 9e7df4ec..79786bcf 100644 --- a/src/NadekoBot/Modules/Administration/Commands/UserPunishCommands.cs +++ b/src/NadekoBot/Modules/Administration/Commands/UserPunishCommands.cs @@ -204,7 +204,7 @@ namespace NadekoBot.Modules.Administration IGrouping[] warnings; using (var uow = _db.UnitOfWork) { - warnings = uow.Warnings.GetAll().GroupBy(x => x.UserId).ToArray(); + warnings = uow.Warnings.GetForGuild(Context.Guild.Id).GroupBy(x => x.UserId).ToArray(); } await Context.Channel.SendPaginatedConfirmAsync((DiscordSocketClient)Context.Client, page, async (curPage) => diff --git a/src/NadekoBot/Services/Database/Repositories/IWarningsRepository.cs b/src/NadekoBot/Services/Database/Repositories/IWarningsRepository.cs index 2b2e5ac4..f8c8296e 100644 --- a/src/NadekoBot/Services/Database/Repositories/IWarningsRepository.cs +++ b/src/NadekoBot/Services/Database/Repositories/IWarningsRepository.cs @@ -7,5 +7,6 @@ namespace NadekoBot.Services.Database.Repositories { Warning[] For(ulong guildId, ulong userId); Task ForgiveAll(ulong guildId, ulong userId, string mod); + Warning[] GetForGuild(ulong id); } } diff --git a/src/NadekoBot/Services/Database/Repositories/Impl/WarningsRepository.cs b/src/NadekoBot/Services/Database/Repositories/Impl/WarningsRepository.cs index aa5a6d7e..ef27ebd9 100644 --- a/src/NadekoBot/Services/Database/Repositories/Impl/WarningsRepository.cs +++ b/src/NadekoBot/Services/Database/Repositories/Impl/WarningsRepository.cs @@ -2,6 +2,7 @@ using Microsoft.EntityFrameworkCore; using System.Linq; using System.Threading.Tasks; +using System; namespace NadekoBot.Services.Database.Repositories.Impl { @@ -32,5 +33,10 @@ namespace NadekoBot.Services.Database.Repositories.Impl }) .ConfigureAwait(false); } + + public Warning[] GetForGuild(ulong id) + { + return _set.Where(x => x.GuildId == id).ToArray(); + } } } diff --git a/src/NadekoBot/Services/Impl/StatsService.cs b/src/NadekoBot/Services/Impl/StatsService.cs index 5965bec5..c5ef6ad8 100644 --- a/src/NadekoBot/Services/Impl/StatsService.cs +++ b/src/NadekoBot/Services/Impl/StatsService.cs @@ -17,7 +17,7 @@ namespace NadekoBot.Services.Impl private readonly IBotCredentials _creds; private readonly DateTime _started; - public const string BotVersion = "1.54b"; + public const string BotVersion = "1.55"; public string Author => "Kwoth#2560"; public string Library => "Discord.Net";