mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-05 13:36:30 +03:00
style: Option -> GuildOption
This commit is contained in:
parent
3e6240f4b8
commit
a1816a9ac1
8 changed files with 14 additions and 14 deletions
|
@ -22,7 +22,7 @@ public static class GuildSettings
|
|||
/// </list>
|
||||
/// </remarks>
|
||||
/// <seealso cref="GuildMemberJoinedResponder" />
|
||||
public static readonly Option<string> WelcomeMessage = new("WelcomeMessage", "default");
|
||||
public static readonly GuildOption<string> WelcomeMessage = new("WelcomeMessage", "default");
|
||||
|
||||
/// <summary>
|
||||
/// Controls what message should be sent in <see cref="PublicFeedbackChannel" /> when a member leaves the guild.
|
||||
|
@ -34,7 +34,7 @@ public static class GuildSettings
|
|||
/// </list>
|
||||
/// </remarks>
|
||||
/// <seealso cref="GuildMemberLeftResponder" />
|
||||
public static readonly Option<string> LeaveMessage = new("LeaveMessage", "default");
|
||||
public static readonly GuildOption<string> LeaveMessage = new("LeaveMessage", "default");
|
||||
|
||||
/// <summary>
|
||||
/// Controls whether or not the <see cref="Messages.Ready" /> message should be sent
|
||||
|
|
|
@ -3,7 +3,7 @@ using Remora.Results;
|
|||
|
||||
namespace TeamOctolings.Octobot.Data.Options;
|
||||
|
||||
public sealed class BoolOption : Option<bool>
|
||||
public sealed class BoolOption : GuildOption<bool>
|
||||
{
|
||||
public BoolOption(string name, bool defaultValue) : base(name, defaultValue) { }
|
||||
|
||||
|
|
|
@ -5,15 +5,15 @@ using Remora.Results;
|
|||
namespace TeamOctolings.Octobot.Data.Options;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an per-guild option.
|
||||
/// Represents a per-guild option.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the option.</typeparam>
|
||||
public class Option<T> : IOption
|
||||
public class GuildOption<T> : IGuildOption
|
||||
where T : notnull
|
||||
{
|
||||
protected readonly T DefaultValue;
|
||||
|
||||
public Option(string name, T defaultValue)
|
||||
public GuildOption(string name, T defaultValue)
|
||||
{
|
||||
Name = name;
|
||||
DefaultValue = defaultValue;
|
|
@ -3,7 +3,7 @@ using Remora.Results;
|
|||
|
||||
namespace TeamOctolings.Octobot.Data.Options;
|
||||
|
||||
public interface IOption
|
||||
public interface IGuildOption
|
||||
{
|
||||
string Name { get; }
|
||||
string Display(JsonNode settings);
|
|
@ -6,7 +6,7 @@ using Remora.Results;
|
|||
namespace TeamOctolings.Octobot.Data.Options;
|
||||
|
||||
/// <inheritdoc />
|
||||
public sealed class LanguageOption : Option<CultureInfo>
|
||||
public sealed class LanguageOption : GuildOption<CultureInfo>
|
||||
{
|
||||
private static readonly Dictionary<string, CultureInfo> CultureInfoCache = new()
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@ using TeamOctolings.Octobot.Extensions;
|
|||
|
||||
namespace TeamOctolings.Octobot.Data.Options;
|
||||
|
||||
public sealed partial class SnowflakeOption : Option<Snowflake>
|
||||
public sealed partial class SnowflakeOption : GuildOption<Snowflake>
|
||||
{
|
||||
public SnowflakeOption(string name) : base(name, 0UL.ToSnowflake()) { }
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ using TeamOctolings.Octobot.Parsers;
|
|||
|
||||
namespace TeamOctolings.Octobot.Data.Options;
|
||||
|
||||
public sealed class TimeSpanOption : Option<TimeSpan>
|
||||
public sealed class TimeSpanOption : GuildOption<TimeSpan>
|
||||
{
|
||||
public TimeSpanOption(string name, TimeSpan defaultValue) : base(name, defaultValue) { }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue