Skip to content

Commit

Permalink
Split Config into ConfigManager and Config Sections
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Sep 23, 2024
1 parent a17d3a9 commit 7d1aefe
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
13 changes: 0 additions & 13 deletions Config/Config.cs → Config/ConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,3 @@ private static void ValidateConfig(object config)
}
}

public sealed class DiscordConfig
{
public const string ConfigurationSectionName = "DiscordConfig";

// TODO: Move the Token to user secrets at some point

[Required]
[RegularExpression(@"^([MN][\w-]{23,25})\.([\w-]{6})\.([\w-]{27,39})$", ErrorMessage = "Invalid token format")]
public required string Token { get; set; }
public ActivityType StatusType { get; set; }
public string? Status { get; set; }
public bool Debug { get; set; }
}
18 changes: 18 additions & 0 deletions Config/DiscordConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.ComponentModel.DataAnnotations;
using Discord;

namespace QuickEdit.Config;

public sealed class DiscordConfig
{
public const string ConfigurationSectionName = "DiscordConfig";

// TODO: Move the Token to user secrets at some point

[Required]
[RegularExpression(@"^([MN][\w-]{23,25})\.([\w-]{6})\.([\w-]{27,39})$", ErrorMessage = "Invalid token format")]
public required string Token { get; set; }
public ActivityType StatusType { get; set; }
public string? Status { get; set; }
public bool Debug { get; set; }
}

0 comments on commit 7d1aefe

Please sign in to comment.