1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-20 00:43:36 +03:00

Trigger scheduled event status update code when a ScheduledEventData is created

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2023-08-12 16:21:21 +05:00
parent f260681b39
commit dd31811dff
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF
2 changed files with 3 additions and 3 deletions

View file

@ -8,12 +8,12 @@ namespace Boyfriend.Data;
/// <remarks>This information is stored on disk as a JSON file.</remarks> /// <remarks>This information is stored on disk as a JSON file.</remarks>
public sealed class ScheduledEventData public sealed class ScheduledEventData
{ {
public ScheduledEventData(GuildScheduledEventStatus status) public ScheduledEventData(GuildScheduledEventStatus? status)
{ {
Status = status; Status = status;
} }
public bool EarlyNotificationSent { get; set; } public bool EarlyNotificationSent { get; set; }
public DateTimeOffset? ActualStartTime { get; set; } public DateTimeOffset? ActualStartTime { get; set; }
public GuildScheduledEventStatus Status { get; set; } public GuildScheduledEventStatus? Status { get; set; }
} }

View file

@ -68,7 +68,7 @@ public sealed class ScheduledEventUpdateService : BackgroundService
{ {
if (!data.ScheduledEvents.ContainsKey(scheduledEvent.ID.Value)) if (!data.ScheduledEvents.ContainsKey(scheduledEvent.ID.Value))
{ {
data.ScheduledEvents.Add(scheduledEvent.ID.Value, new ScheduledEventData(scheduledEvent.Status)); data.ScheduledEvents.Add(scheduledEvent.ID.Value, new ScheduledEventData(null));
} }
var storedEvent = data.ScheduledEvents[scheduledEvent.ID.Value]; var storedEvent = data.ScheduledEvents[scheduledEvent.ID.Value];