diff --git a/src/Data/Options/IOption.cs b/src/Data/Options/IOption.cs index f6acf9a..211c5b2 100644 --- a/src/Data/Options/IOption.cs +++ b/src/Data/Options/IOption.cs @@ -4,7 +4,7 @@ using Remora.Results; namespace Boyfriend.Data.Options; public interface IOption { - string Name { get; init; } + string Name { get; } object GetAsObject(JsonNode settings); Result Set(JsonNode settings, string from); } diff --git a/src/Data/Options/Option.cs b/src/Data/Options/Option.cs index a08b75e..976c09c 100644 --- a/src/Data/Options/Option.cs +++ b/src/Data/Options/Option.cs @@ -15,7 +15,6 @@ public class Option : IOption { DefaultValue = defaultValue; } - public Type Type { get; set; } = typeof(T); public string Name { get; init; } public object GetAsObject(JsonNode settings) { diff --git a/src/Data/Options/TimeSpanOption.cs b/src/Data/Options/TimeSpanOption.cs index aa3c8d4..68b33ad 100644 --- a/src/Data/Options/TimeSpanOption.cs +++ b/src/Data/Options/TimeSpanOption.cs @@ -11,7 +11,9 @@ public class TimeSpanOption : Option { public TimeSpanOption(string name, TimeSpan defaultValue) : base(name, defaultValue) { } public override Result Set(JsonNode settings, string from) { - if (!Parser.TryParseAsync(from).Result.IsDefined(out var span)) + var task = Parser.TryParseAsync(from).AsTask().GetAwaiter().GetResult(); + + if (task.IsDefined(out var span)) return Result.FromError(new ArgumentInvalidError(nameof(from), Messages.InvalidSettingValue)); settings[Name] = span.ToString(); diff --git a/src/Services/GuildUpdateService.cs b/src/Services/GuildUpdateService.cs index 69ccc93..e315deb 100644 --- a/src/Services/GuildUpdateService.cs +++ b/src/Services/GuildUpdateService.cs @@ -302,7 +302,7 @@ public class GuildUpdateService : BackgroundService { } /// - /// Handles sending a notification, mentioning the s, + /// Handles sending a notification, mentioning the and event subscribers, /// when a scheduled event is about to start, has started or completed /// in a guild's if one is set. /// diff --git a/src/Services/UtilityService.cs b/src/Services/UtilityService.cs index 6279ae9..3b6a2bf 100644 --- a/src/Services/UtilityService.cs +++ b/src/Services/UtilityService.cs @@ -104,16 +104,11 @@ public class UtilityService : IHostedService { } /// - /// Gets the string mentioning all s related to a scheduled + /// Gets the string mentioning the and event subscribers related to a scheduled /// event. /// - /// - /// If the guild settings enables , then the - /// will also be mentioned. - /// /// - /// The scheduled event whose subscribers will be mentioned if the guild settings enables - /// . + /// The scheduled event whose subscribers will be mentioned. /// /// The settings of the guild containing the scheduled event /// The cancellation token for this operation.