Esempio n. 1
0
        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.");
        }
Esempio n. 2
0
        private void LoadConfig()
        {
            string path = Path.Combine(TShock.SavePath, "DiscordBridge.json");

            Config = Util.ConfigFile.Read(path);
        }