Exemplo n.º 1
0
        private Task _client_LoggedOut()
        {
            Logging.Log($"Client logged out");
            var status = new DiscordStatusNotification("TeamCord", "Status");

            status.UpdateStatus(LoginState.LoggedOut);
            return(Task.CompletedTask);
        }
Exemplo n.º 2
0
        private Task _client_Connected()
        {
            Logging.Log($"Client connected");
            Connected = true;
            var status = new DiscordStatusNotification("TeamCord", "Status");

            status.UpdateStatus(_client.LoginState);
            _voiceChannelService.OwnUserID = _client.CurrentUser.Id;
            return(Task.CompletedTask);
        }
Exemplo n.º 3
0
        private Task _client_Disconnected(Exception arg)
        {
            Logging.Log($"Client disconnected");
            Connected = false;
            var status = new DiscordStatusNotification("TeamCord", "Status");

            status.UpdateStatus(LoginState.LoggedOut);
            ConnectionChanged?.Invoke(this, new ConnectionChangedEventArgs(ConnectionType.Discord, false));
            return(Task.CompletedTask);
        }
Exemplo n.º 4
0
        private void _audioService_VoiceConnected(object sender, EventArgs e)
        {
            Logging.Log($"Client connected to voice");
            var status = new DiscordStatusNotification("TeamCord", "Status");

            status.UpdateStatus(ConnectionState.Connected);
            new ConnectionNotification().Notify(_currentChannel, ConnectionState.Connected);
            ConnectionChanged?.Invoke(this, new ConnectionChangedEventArgs(ConnectionType.Voice, true));
            TrayIcon.VolumeMenuItemEnabled = true;
        }