コード例 #1
0
        private void Loaded()
        {
            _settings = Config.ReadObject <Settings>();

            if (string.IsNullOrEmpty(_settings.Apikey) || _settings.Apikey == null || _settings.Apikey == "APIkey")
            {
                PrintError("API key is empty or invalid!");
                return;
            }

            foreach (var dc in Discord.Clients)
            {
                if (dc.Settings.ApiToken == _settings.Apikey)
                {
                    Discord.CloseClient(dc);
                }
            }
            //Discord.Clients.Clear();
            Discord.CreateClient(this, _settings.Apikey);
        }
コード例 #2
0
 private void Unload()
 {
     SaveData();
     Discord.CloseClient(_client);
 }
コード例 #3
0
 private void Unload() => Discord.CloseClient(Client);
コード例 #4
0
 private void CloseClient() => Discord.CloseClient(Client);
コード例 #5
0
 private void Unload()
 {
     Discord.CloseClient(Client);
     SaveData();
 }
コード例 #6
0
 private void Unload()
 {
     Discord.CloseClient(_client);
 }