Esempio 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);
            }
        }
Esempio 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);
        }
Esempio 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;
 }