1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-01-31 09:09:00 +03:00
Octobot/Boyfriend/GuildConfig.cs

40 lines
1.5 KiB
C#
Raw Normal View History

2021-12-15 09:19:14 +03:00
using System.Text.Json;
namespace Boyfriend;
public class GuildConfig {
public ulong Id { get; }
public string Lang { get; set; }
public string Prefix { get; set; }
public bool RemoveRolesOnMute { get; set; }
2021-12-15 22:07:04 +03:00
public bool UseSystemChannel { get; set; }
public bool SendWelcomeMessages { get; set; }
public string WelcomeMessage { get; set; }
public ulong DefaultRole { get; set; }
2021-12-15 22:07:04 +03:00
public ulong MuteRole { get; set; }
public ulong AdminLogChannel { get; set; }
public ulong BotLogChannel { get; set; }
public Dictionary<ulong, List<ulong>> RolesRemovedOnMute { get; set; }
2021-12-15 09:19:14 +03:00
2021-12-15 22:07:04 +03:00
public GuildConfig(ulong id, string lang, string prefix, bool removeRolesOnMute, bool useSystemChannel,
bool sendWelcomeMessages, string welcomeMessage, ulong defaultRole, ulong muteRole, ulong adminLogChannel,
ulong botLogChannel) {
2021-12-15 09:19:14 +03:00
Id = id;
Lang = lang;
Prefix = prefix;
RemoveRolesOnMute = removeRolesOnMute;
2021-12-15 22:07:04 +03:00
UseSystemChannel = useSystemChannel;
SendWelcomeMessages = sendWelcomeMessages;
WelcomeMessage = welcomeMessage;
DefaultRole = defaultRole;
2021-12-15 22:07:04 +03:00
MuteRole = muteRole;
AdminLogChannel = adminLogChannel;
BotLogChannel = botLogChannel;
RolesRemovedOnMute = new Dictionary<ulong, List<ulong>>();
2021-12-15 09:19:14 +03:00
}
public async Task Save() {
2021-12-15 09:19:14 +03:00
await using var stream = File.OpenWrite("config_" + Id + ".json");
await JsonSerializer.SerializeAsync(stream, this);
}
}