mirror of
https://github.com/NoiTheCat/BirthdayBot.git
synced 2024-11-21 21:54:36 +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;
|
using System.Text;
|
||||||
|
|
||||||
namespace BirthdayBot.ApplicationCommands;
|
namespace BirthdayBot.ApplicationCommands;
|
||||||
|
|
||||||
[RequireGuildContext]
|
[RequireGuildContext]
|
||||||
[Group("birthday", HelpCmdBirthday)]
|
[Group("birthday", HelpCmdBirthday)]
|
||||||
public class BirthdayModule : BotModuleBase {
|
public class BirthdayModule : BotModuleBase {
|
||||||
|
@ -47,7 +46,7 @@ public class BirthdayModule : BotModuleBase {
|
||||||
if (user.IsNew) db.UserEntries.Add(user);
|
if (user.IsNew) db.UserEntries.Add(user);
|
||||||
user.BirthMonth = inmonth;
|
user.BirthMonth = inmonth;
|
||||||
user.BirthDay = inday;
|
user.BirthDay = inday;
|
||||||
user.TimeZone = inzone;
|
user.TimeZone = inzone ?? user.TimeZone;
|
||||||
try {
|
try {
|
||||||
await db.SaveChangesAsync();
|
await db.SaveChangesAsync();
|
||||||
} catch (Microsoft.EntityFrameworkCore.DbUpdateException e)
|
} catch (Microsoft.EntityFrameworkCore.DbUpdateException e)
|
||||||
|
|
Loading…
Reference in a new issue