From 0b1549633bd4a299f77266cab883656ec6aed279 Mon Sep 17 00:00:00 2001
From: AnalogFeelings <51166756+AnalogFeelings@users.noreply.github.com>
Date: Sat, 25 May 2024 05:00:00 +0200
Subject: [PATCH] [Library -> Attributes] Remove unused attributes.
---
.../Attributes/RequiresReboot.cs | 29 ------------------
.../Attributes/SensitiveSetting.cs | 30 -------------------
.../SammBot.Library/Models/Data/BotConfig.cs | 17 +----------
3 files changed, 1 insertion(+), 75 deletions(-)
delete mode 100644 Source/SammBot.Library/Attributes/RequiresReboot.cs
delete mode 100644 Source/SammBot.Library/Attributes/SensitiveSetting.cs
diff --git a/Source/SammBot.Library/Attributes/RequiresReboot.cs b/Source/SammBot.Library/Attributes/RequiresReboot.cs
deleted file mode 100644
index 87bfe02..0000000
--- a/Source/SammBot.Library/Attributes/RequiresReboot.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-#region License Information (GPLv3)
-// Samm-Bot - A lightweight Discord.NET bot for moderation and other purposes.
-// Copyright (C) 2021-2024 Analog Feelings
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see .
-#endregion
-
-namespace SammBot.Library.Attributes;
-
-///
-/// An attribute used to denote a setting that requires a full bot reboot to
-/// do any effect.
-///
-[AttributeUsage(AttributeTargets.Property)]
-public class RequiresReboot : Attribute
-{
- // No members.
-}
\ No newline at end of file
diff --git a/Source/SammBot.Library/Attributes/SensitiveSetting.cs b/Source/SammBot.Library/Attributes/SensitiveSetting.cs
deleted file mode 100644
index 8097921..0000000
--- a/Source/SammBot.Library/Attributes/SensitiveSetting.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-#region License Information (GPLv3)
-// Samm-Bot - A lightweight Discord.NET bot for moderation and other purposes.
-// Copyright (C) 2021-2024 Analog Feelings
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see .
-#endregion
-
-namespace SammBot.Library.Attributes;
-
-///
-/// An attribute used to denote a setting that contains sensitive information.
-///
-/// This prevents the setting from being shown in public.
-///
-[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
-public class SensitiveSetting : Attribute
-{
- // No members.
-}
\ No newline at end of file
diff --git a/Source/SammBot.Library/Models/Data/BotConfig.cs b/Source/SammBot.Library/Models/Data/BotConfig.cs
index acd1ea4..59a1df6 100644
--- a/Source/SammBot.Library/Models/Data/BotConfig.cs
+++ b/Source/SammBot.Library/Models/Data/BotConfig.cs
@@ -16,8 +16,6 @@
// along with this program. If not, see .
#endregion
-using SammBot.Library.Attributes;
-
namespace SammBot.Library.Models.Data;
public class BotConfig
@@ -36,7 +34,7 @@ public class BotConfig
public string ShipBarEndFull { get; set; } = string.Empty;
// Behavior
- [RequiresReboot] public int MessageCacheSize { get; set; } = 2000;
+ public int MessageCacheSize { get; set; } = 2000;
public int TagDistance { get; set; } = 3;
public bool OnlyOwnerMode { get; set; } = false;
public bool RotatingStatus { get; set; } = false;
@@ -44,24 +42,11 @@ public class BotConfig
public string TwitchUrl { get; set; } = "https://www.twitch.tv/coreaesthetics";
public string CommandLogFormat { get; set; } = "Executing command \"{0}\". Channel: #{1}. User: @{2}.";
- [RequiresReboot]
- [SensitiveSetting]
public string HttpUserAgent { get; set; } = "Placeholder User Agent (.NET Application)";
// API Tokens
- [RequiresReboot]
- [SensitiveSetting]
public string BotToken { get; set; } = string.Empty;
-
- [RequiresReboot]
- [SensitiveSetting]
public string CatKey { get; set; } = string.Empty;
-
- [RequiresReboot]
- [SensitiveSetting]
public string DogKey { get; set; } = string.Empty;
-
- [RequiresReboot]
- [SensitiveSetting]
public string OpenWeatherKey { get; set; } = string.Empty;
}
\ No newline at end of file