Restructured the project structure back to the way it was, there's no reasonable way to split the modules

This commit is contained in:
Kwoth
2024-04-26 22:26:24 +00:00
parent 6c9c8bf63e
commit e0819f760c
768 changed files with 192 additions and 1047 deletions

View File

@@ -0,0 +1,36 @@
using NadekoBot.Common.Configs;
namespace NadekoBot.Modules.Patronage;
public class PatronageConfig : ConfigServiceBase<PatronConfigData>
{
public override string Name
=> "patron";
private static readonly TypedKey<PatronConfigData> _changeKey
= new("config.patron.updated");
private const string FILE_PATH = "data/patron.yml";
public PatronageConfig(IConfigSeria serializer, IPubSub pubSub) : base(FILE_PATH, serializer, pubSub, _changeKey)
{
AddParsedProp("enabled",
x => x.IsEnabled,
bool.TryParse,
ConfigPrinters.ToString);
Migrate();
}
private void Migrate()
{
ModifyConfig(c =>
{
if (c.Version == 1)
{
c.Version = 2;
c.IsEnabled = false;
}
});
}
}