Fixed plugin reloading

This commit is contained in:
2025-06-17 17:20:03 +03:00
parent e9b61cc4be
commit f68b6cb877
6 changed files with 68 additions and 56 deletions

View File

@@ -44,6 +44,8 @@ public class DiscordBotApplication : IDiscordBotApplication
return;
}
await _PluginLoader.UnloadAllPlugins();
await Client.LogoutAsync();
await Client.StopAsync();
@@ -54,6 +56,7 @@ public class DiscordBotApplication : IDiscordBotApplication
await Client.DisposeAsync();
IsReady = false;
}
@@ -73,7 +76,7 @@ public class DiscordBotApplication : IDiscordBotApplication
};
DiscordSocketClient client = new DiscordSocketClient(config);
Client = client;
_Service = new CommandService();
@@ -82,8 +85,8 @@ public class DiscordBotApplication : IDiscordBotApplication
client.Ready += Ready;
client.Disconnected += Client_Disconnected;
Client = client;
await client.LoginAsync(TokenType.Bot, _Configuration.Get<string>("token"));
await client.StartAsync();
_CommandServiceHandler = new CommandHandler(_Logger, _PluginLoader, _Configuration, _Service);