2023-08-15 08:23:58 +03:00
|
|
|
using System.Text.Json.Serialization;
|
2023-07-09 16:32:14 +03:00
|
|
|
using Remora.Discord.API.Abstractions.Objects;
|
|
|
|
|
2024-05-16 18:34:26 +03:00
|
|
|
namespace TeamOctolings.Octobot.Data;
|
2023-07-09 16:32:14 +03:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Stores information about scheduled events. This information is not provided by the Discord API.
|
|
|
|
/// </summary>
|
|
|
|
/// <remarks>This information is stored on disk as a JSON file.</remarks>
|
2023-08-02 23:51:16 +03:00
|
|
|
public sealed class ScheduledEventData
|
|
|
|
{
|
2023-08-15 08:23:58 +03:00
|
|
|
public ScheduledEventData(ulong id, string name, DateTimeOffset scheduledStartTime,
|
|
|
|
GuildScheduledEventStatus status)
|
2023-08-02 23:51:16 +03:00
|
|
|
{
|
2023-08-14 16:24:22 +03:00
|
|
|
Id = id;
|
|
|
|
Name = name;
|
2023-08-15 08:23:58 +03:00
|
|
|
ScheduledStartTime = scheduledStartTime;
|
2023-07-09 16:32:14 +03:00
|
|
|
Status = status;
|
2023-08-15 08:23:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
[JsonConstructor]
|
|
|
|
public ScheduledEventData(ulong id, string name, bool earlyNotificationSent, DateTimeOffset scheduledStartTime,
|
|
|
|
DateTimeOffset? actualStartTime, GuildScheduledEventStatus? status, bool scheduleOnStatusUpdated)
|
|
|
|
{
|
|
|
|
Id = id;
|
|
|
|
Name = name;
|
|
|
|
EarlyNotificationSent = earlyNotificationSent;
|
2023-08-14 16:24:22 +03:00
|
|
|
ScheduledStartTime = scheduledStartTime;
|
2023-08-15 08:23:58 +03:00
|
|
|
ActualStartTime = actualStartTime;
|
|
|
|
Status = status;
|
|
|
|
ScheduleOnStatusUpdated = scheduleOnStatusUpdated;
|
2023-07-09 16:32:14 +03:00
|
|
|
}
|
|
|
|
|
2023-08-14 16:24:22 +03:00
|
|
|
public ulong Id { get; }
|
|
|
|
public string Name { get; set; }
|
2023-08-02 23:51:16 +03:00
|
|
|
public bool EarlyNotificationSent { get; set; }
|
2023-08-14 16:24:22 +03:00
|
|
|
public DateTimeOffset ScheduledStartTime { get; set; }
|
2023-08-02 23:51:16 +03:00
|
|
|
public DateTimeOffset? ActualStartTime { get; set; }
|
2023-08-12 16:47:14 +03:00
|
|
|
public GuildScheduledEventStatus? Status { get; set; }
|
2023-08-14 16:24:22 +03:00
|
|
|
public bool ScheduleOnStatusUpdated { get; set; } = true;
|
2023-07-09 16:32:14 +03:00
|
|
|
}
|