$waifuinfo will update target user's username and discrimnator in case they changed

This commit is contained in:
Kwoth 2017-02-05 10:06:36 +01:00
parent 871237af4e
commit 7e79dd4163

View File

@ -403,6 +403,7 @@ namespace NadekoBot.Modules.Gambling
x.UpdateType == WaifuUpdateType.Claimed &&
x.New == null);
if (w == null)
{
uow.Waifus.Add(w = new WaifuInfo()
{
Affinity = null,
@ -410,6 +411,10 @@ namespace NadekoBot.Modules.Gambling
Price = 1,
Waifu = uow.DiscordUsers.GetOrCreate(target),
});
}
w.Waifu.Username = target.Username;
w.Waifu.Discriminator = target.Discriminator;
await uow.CompleteAsync().ConfigureAwait(false);
}