Exemplo n.º 1
0
        public bool VerifyLogin(string username, string password)
        {
            ShareSettings.Default.Reload();
            AccessToken = ShareSettings.Default.TwitchAccessToken;

            if (VerifyAccessToken())
            {
                Chat = new TwitchChat(AccessToken);

                return(true);
            }
            else
            {
                var form = new TwitchOAuthForm();
                form.ShowDialog();

                AccessToken = form.AccessToken;

                var verified = VerifyAccessToken();

                if (verified)
                {
                    Chat = new TwitchChat(AccessToken);
                }

                return(verified);
            }
        }
Exemplo n.º 2
0
        public TwitchChat ConnectToChat(string channel = null)
        {
            channel = (channel ?? ChannelName).ToLower();
            if (ConnectedChats.ContainsKey(channel))
            {
                throw new ArgumentException("Already connected to channel");
            }
            var chat = new TwitchChat(AccessToken, channel);

            ConnectedChats.Add(channel, chat);
            return(chat);
        }
Exemplo n.º 3
0
 public TwitchChat ConnectToChat(string channel = null)
 {
     channel = (channel ?? ChannelName).ToLower();
     if (ConnectedChats.ContainsKey(channel))
         throw new ArgumentException("Already connected to channel");
     var chat = new TwitchChat(AccessToken, channel);
     ConnectedChats.Add(channel, chat);
     return chat;
 }