コード例 #1
0
ファイル: ConnectionHandler.cs プロジェクト: Bealze/TeamCord
        private Task _client_LoggedOut()
        {
            Logging.Log($"Client logged out");
            var status = new DiscordStatusNotification("TeamCord", "Status");

            status.UpdateStatus(LoginState.LoggedOut);
            return(Task.CompletedTask);
        }
コード例 #2
0
ファイル: ConnectionHandler.cs プロジェクト: Bealze/TeamCord
        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);
        }
コード例 #3
0
ファイル: ConnectionHandler.cs プロジェクト: Bealze/TeamCord
        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);
        }
コード例 #4
0
ファイル: ConnectionHandler.cs プロジェクト: Bealze/TeamCord
        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;
        }