Fix time zone unset when updating birthday (#26)

This commit is contained in:
Noi 2022-09-16 21:48:46 -07:00
parent 3729474525
commit 1f6772d18a

View file

@ -3,7 +3,6 @@ using Discord.Interactions;
using System.Text;
namespace BirthdayBot.ApplicationCommands;
[RequireGuildContext]
[Group("birthday", HelpCmdBirthday)]
public class BirthdayModule : BotModuleBase {
@ -47,7 +46,7 @@ public class BirthdayModule : BotModuleBase {
if (user.IsNew) db.UserEntries.Add(user);
user.BirthMonth = inmonth;
user.BirthDay = inday;
user.TimeZone = inzone;
user.TimeZone = inzone ?? user.TimeZone;
try {
await db.SaveChangesAsync();
} catch (Microsoft.EntityFrameworkCore.DbUpdateException e)