From 07e15ff0fb2dde2cb1cbea75063fa565ab9002fc Mon Sep 17 00:00:00 2001 From: Elijah R Date: Tue, 2 Apr 2024 22:57:53 -0400 Subject: [PATCH] this can go in the config file idk what i was thinking --- EmperorPalpatine/Constants.cs | 12 ------------ EmperorPalpatine/DiscordCommands.cs | 2 +- EmperorPalpatine/IConfig.cs | 1 + config.toml.example | 1 + 4 files changed, 3 insertions(+), 13 deletions(-) delete mode 100644 EmperorPalpatine/Constants.cs diff --git a/EmperorPalpatine/Constants.cs b/EmperorPalpatine/Constants.cs deleted file mode 100644 index db5f91f..0000000 --- a/EmperorPalpatine/Constants.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace EmperorPalpatine; - -public static class Constants -{ - public static readonly string[] BotNames = new[] - { - "Emperor Palpatine", - "Emperor Kevin", - "General Darian", - "Specialized Egg" - }; -} \ No newline at end of file diff --git a/EmperorPalpatine/DiscordCommands.cs b/EmperorPalpatine/DiscordCommands.cs index 7e94350..7c39c73 100644 --- a/EmperorPalpatine/DiscordCommands.cs +++ b/EmperorPalpatine/DiscordCommands.cs @@ -26,7 +26,7 @@ public class DiscordCommands : ApplicationCommandModule StringBuilder userlist = new(); StringBuilder botlist = new(); foreach (User user in vm.cvm.Users) { - var b = (Constants.BotNames.Contains(user.Username)) ? botlist : userlist; + var b = (Program.Config.KnownBots.Contains(user.Username)) ? botlist : userlist; switch (user.Rank) { case Rank.Admin: b.Append(":red_circle: "); diff --git a/EmperorPalpatine/IConfig.cs b/EmperorPalpatine/IConfig.cs index faaebe4..a8f3d6d 100644 --- a/EmperorPalpatine/IConfig.cs +++ b/EmperorPalpatine/IConfig.cs @@ -3,6 +3,7 @@ namespace EmperorPalpatine; public class IConfig { public string Username { get; set; } + public string[] KnownBots { get; set; } public string IPInfoToken { get; set; } public int ConnectRetryMaxSeconds { get; set; } public ConfigDiscord Discord { get; set; } diff --git a/config.toml.example b/config.toml.example index 54c5a37..a01fe36 100644 --- a/config.toml.example +++ b/config.toml.example @@ -1,4 +1,5 @@ Username = "Emperor Palpatine" +KnownBots = ["AnyOSInstallBot", "Emperor Palpatine", "Emperor Kevin", "General Darian", "Specialized Egg"] IPInfoToken = "1234567890" ConnectRetryMaxSeconds = 120 VMs = [