mirror of
https://github.com/NoiTheCat/BirthdayBot.git
synced 2024-11-24 17:34:13 +00:00
Merge pull request #28 from NoiTheCat/fixvanishingtz
Fix time zone unset when updating birthday (#26)
This commit is contained in:
commit
21785acfb1
1 changed files with 1 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue