예제 #1
0
        public ErrorMessage(TwitchBot inBot, Popup inCurrentPopup)
        {
            Bot = inBot;
            CurrentPopup = inCurrentPopup;

            InitializeComponent();
        }
예제 #2
0
 public Info(TwitchBot inBot, Popup inCurrentPopup)
 {
     Bot = inBot;
     
     CurrentPopup = inCurrentPopup;
     InitializeComponent();
 }
 public AddNewQuizObjectPop(TwitchBot inBot, Popup inCurrentPopup, System.Windows.Controls.DataGrid inQuizDataGrid)
 {
     this.Loaded += AddNewQuizObjectPop_Loaded;
     Grid = inQuizDataGrid;
     Bot = inBot;
     CurrentPopup = inCurrentPopup;
     InitializeComponent();
 }
        public AddNewQuizObjectPop(TwitchBot inBot, Popup inCurrentPopup)
        {
            this.Loaded += AddNewQuizObjectPop_Loaded;

            Bot = inBot;
            CurrentPopup = inCurrentPopup;
            InitializeComponent();
        }
예제 #5
0
        public ErrorMessage(TwitchBot inBot, Popup inCurrentPopup, String inError)
        {
            Bot = inBot;
            CurrentPopup = inCurrentPopup;

            InitializeComponent();
           
            ErrorMessageField.Text = inError;
        }
        public ChannelSettings(TwitchBot inBot, Popup inCurrentPopup)
        {
            this.Loaded += ChannelSettings_Loaded;

            Bot = inBot;
            CurrentPopup = inCurrentPopup;

            InitializeComponent();
        }
예제 #7
0
        /// <summary>
        /// The constructor of the main class.
        /// </summary>
        public TwitchBot()
        {
            
            InitializeComponent();
            

            GUIManager.Bot = this;
            me = this;
        }
        public ChannelSettings(TwitchBot inBot, Popup inCurrentPopup, MetroWindow inWindow)
        {
            
            this.Loaded += ChannelSettings_Loaded;

            Bot = inBot;
            CurrentPopup = inCurrentPopup;
            mWindow = inWindow;

            InitializeComponent();
        }
예제 #9
0
		static void Main(){

			TwitchBot bot = new TwitchBot();
			//bot.Proxy = new Endpoint();
			bot.Destination = new Endpoint();

		
			//bot.Proxy.EndpointAddress = "eproxy.volga";
			//bot.Proxy.EndpointPort = 8080;

			bot.Destination.EndpointAddress = "irc.twitch.tv";
			bot.Destination.EndpointPort = 6667;

			bot.Connect();
            
			bot.SendMessage("PASS oauth:lxubjjlsavkv1o3ih44d3csztfpw7vu\r\n");
            bot.SendMessage("NICK sovietmade\r\n");
            bot.SendMessage("JOIN #sovietmade\r\n");
            bot.SendMessage("PRIVMSG #sovietmade :test\r\n");
			Thread.Sleep(10000);
			bot.DumpMessageQ();
			Thread.Sleep(1000000);
            Console.WriteLine("");
		}
예제 #10
0
        public ImagePop(TwitchBot inBot, Popup inCurrentPopup, System.Drawing.Bitmap inImage)
        {
            Bot = inBot;
            CurrentPopup = inCurrentPopup;
            
            if (inImage != null)
            {
                var bitmap = new System.Windows.Media.Imaging.BitmapImage();
                bitmap.BeginInit();
                MemoryStream memoryStream = new MemoryStream();
                inImage.Save(memoryStream, ImageFormat.Bmp);
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
                bitmap.StreamSource = memoryStream;
                bitmap.EndInit();
                src = bitmap;
                
            }

            InitializeComponent();
            if (src != null)
            {
                ImageQuestion.Source = src;
            }
        }
        public LoyalityPointsRewards(TwitchBot inBot, Popup inCurrentPopup)
        {
            this.Loaded += LoyalityPointsRewards_Loaded;
            Bot = inBot;
            CurrentPopup = inCurrentPopup;

            InitializeComponent();
        }
예제 #12
0
        static async Task Main(string[] args)
        {
            string password    = Environment.GetEnvironmentVariable("TWITCH_OAUTH");
            string botUsername = "******";

            var twitchBot = new TwitchBot(botUsername, password);

            twitchBot.Start().SafeFireAndForget();
            //We could .SafeFireAndForget() these two calls if we want to
            await twitchBot.JoinChannel("actuallytobby");

            await twitchBot.SendMessage("actuallytobby", "Hey my bot has started up");

            twitchBot.OnMessage += async(sender, twitchChatMessage) =>
            {
                if (twitchChatMessage.Message.ToLower() == "up")
                {
                    twitchBot.enteredCommands.Enqueue(PossibleCommands.Up);
                }

                if (twitchChatMessage.Message.ToLower() == "down")
                {
                    twitchBot.enteredCommands.Enqueue(PossibleCommands.Down);
                }


                if (twitchChatMessage.Message.ToLower() == "left")
                {
                    twitchBot.enteredCommands.Enqueue(PossibleCommands.Left);
                }


                if (twitchChatMessage.Message.ToLower() == "right")
                {
                    twitchBot.enteredCommands.Enqueue(PossibleCommands.Right);
                }


                if (twitchChatMessage.Message.ToLower() == "a")
                {
                    twitchBot.enteredCommands.Enqueue(PossibleCommands.A);
                }


                if (twitchChatMessage.Message.ToLower() == "b")
                {
                    twitchBot.enteredCommands.Enqueue(PossibleCommands.B);
                }


                if (twitchChatMessage.Message.ToLower() == "start")
                {
                    twitchBot.enteredCommands.Enqueue(PossibleCommands.Start);
                }


                if (twitchChatMessage.Message.ToLower() == "select")
                {
                    twitchBot.enteredCommands.Enqueue(PossibleCommands.Select);
                }

                if (twitchChatMessage.Message.ToLower() == "l")
                {
                    twitchBot.enteredCommands.Enqueue(PossibleCommands.L);
                }

                if (twitchChatMessage.Message.ToLower() == "r")
                {
                    twitchBot.enteredCommands.Enqueue(PossibleCommands.R);
                }


                Console.WriteLine($"{twitchChatMessage.Sender} said '{twitchChatMessage.Message}'");
                //Listen for !hey command
                if (twitchChatMessage.Message.StartsWith("!hey"))
                {
                    await twitchBot.SendMessage(twitchChatMessage.Channel, $"Hey there {twitchChatMessage.Sender}");
                }
            };

            await Task.Delay(-1);
        }