changed to .json file instead of database for settings

This commit is contained in:
2023-03-24 21:52:03 +02:00
parent 7e2fa02d07
commit 460a85944a
15 changed files with 207 additions and 312 deletions

View File

@@ -60,17 +60,17 @@ public class Boot
/// <returns>Task</returns>
public async Task Awake(DiscordSocketConfig? config = null)
{
if(config is null)
config = new DiscordSocketConfig
{
if (config is null)
config = new DiscordSocketConfig
{
AlwaysDownloadUsers = true,
AlwaysDownloadUsers = true,
//Disable system clock checkup (for responses at slash commands)
UseInteractionSnowflakeDate = false,
//Disable system clock checkup (for responses at slash commands)
UseInteractionSnowflakeDate = false,
GatewayIntents = GatewayIntents.All
};
GatewayIntents = GatewayIntents.All
};
client = new DiscordSocketClient(config);
service = new CommandService();
@@ -105,7 +105,7 @@ public class Boot
{
if (arg.Message.Contains("401"))
{
Config.Variables.RemoveKey("token");
Config.Data.Remove("token");
Logger.LogError("The token is invalid. Please restart the bot and enter a valid token.");
await Task.Delay(4000);
Environment.Exit(0);