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

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