Exemplo n.º 1
0
        public bool JoinTwitchChannel(string channel)
        {
            if (_client.JoinedChannels.Any(c => c.Channel == channel))
            {
                return(false);
            }

            _client.JoinChannel(channel);
            return(true);
        }
Exemplo n.º 2
0
        public async Task JoinChannel(string channelName)
        {
            if (_twitchClient.JoinedChannels.Any(x => string.Equals(channelName, x.Channel, StringComparison.OrdinalIgnoreCase)))
            {
                return;
            }

            _twitchClient.JoinChannel(channelName);
            _twitchClient.OnJoinedChannel += TwitchClient_OnJoinedChannel;

            await _joinChannelCompletionTask.Task.ConfigureAwait(false);
        }
Exemplo n.º 3
0
        private static Task <JoinedChannel> JoinChannel(ITwitchClient client, string channel)
        {
            var source = new TaskCompletionSource <JoinedChannel>();

            void OnJoinedChannel(object sender, OnJoinedChannelArgs e)
            {
                if (e.Channel == channel)
                {
                    client.OnJoinedChannel -= OnJoinedChannel;
                    source.SetResult(client.GetJoinedChannel(channel));
                }
            }

            client.OnJoinedChannel += OnJoinedChannel;
            client.JoinChannel(channel);
            return(source.Task);
        }
Exemplo n.º 4
0
 public override void Register(ITwitchClient client)
 {
     client.JoinChannel(ListenChannel);
     client.OnMessageReceived += TwitchClient_OnMessageReceived;
 }
Exemplo n.º 5
0
 private static void JoinChannel(string v)
 {
     _client.LeaveChannel(_channel);
     _channel = v;
     _client.JoinChannel(_channel);
 }
Exemplo n.º 6
0
 public void JoinChannel(string channel)
 {
     twitchClient.JoinChannel(channel);
 }