private async void DiscordReload(CommandArgs args) { Config = Util.ConfigFile.Read(Path.Combine(TShock.SavePath, "DiscordBridge.json")); await DiscordBot.DisconnectAsync(); DiscordBot = new DiscordClient(new DiscordConfiguration { Token = Config.DiscordBotToken, TokenType = TokenType.Bot }); await DiscordBot.ConnectAsync(); args.Player.SendSuccessMessage("Succesfully reloaded DiscordBridge."); }
private void LoadConfig() { string path = Path.Combine(TShock.SavePath, "DiscordBridge.json"); Config = Util.ConfigFile.Read(path); }