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; }
|
2022-01-18 20:38:15 +03:00
|
|
|
|
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,
|
2022-01-18 20:38:15 +03:00
|
|
|
|
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;
|
2022-01-18 20:38:15 +03:00
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
2022-01-18 20:38:15 +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);
|
|
|
|
|
}
|
|
|
|
|
}
|