From 749c63aec3e14ef6e225e1ef3130dc5c28b34a6a Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Tue, 16 May 2017 18:53:10 +0200 Subject: [PATCH] you can now divorce people using their id --- .../Modules/Gambling/Commands/WaifuClaimCommands.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/NadekoBot/Modules/Gambling/Commands/WaifuClaimCommands.cs b/src/NadekoBot/Modules/Gambling/Commands/WaifuClaimCommands.cs index c1d16578..3822c8c5 100644 --- a/src/NadekoBot/Modules/Gambling/Commands/WaifuClaimCommands.cs +++ b/src/NadekoBot/Modules/Gambling/Commands/WaifuClaimCommands.cs @@ -188,9 +188,15 @@ namespace NadekoBot.Modules.Gambling private static readonly TimeSpan _divorceLimit = TimeSpan.FromHours(6); [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] - public async Task Divorce([Remainder]IUser target) + [Priority(1)] + public Task Divorce([Remainder]IUser target) => Divorce(target.Id); + + [NadekoCommand, Usage, Description, Aliases] + [RequireContext(ContextType.Guild)] + [Priority(0)] + public async Task Divorce([Remainder]ulong targetId) { - if (target.Id == Context.User.Id) + if (targetId == Context.User.Id) return; DivorceResult result; @@ -199,7 +205,7 @@ namespace NadekoBot.Modules.Gambling WaifuInfo w = null; using (var uow = DbHandler.UnitOfWork()) { - w = uow.Waifus.ByWaifuUserId(target.Id); + w = uow.Waifus.ByWaifuUserId(targetId); var now = DateTime.UtcNow; if (w?.Claimer == null || w.Claimer.UserId != Context.User.Id) result = DivorceResult.NotYourWife;