Ejemplo n.º 1
0
        private void MenuItem_RunBotClicked(object sender, RoutedEventArgs e)
        {
            if (!IsBotRunning)
            {
                var connectionConfig = SuiBot_Core.Storage.ConnectionConfig.Load();
                var coreConfig       = SuiBot_Core.Storage.CoreConfig.Load();

                if (!connectionConfig.IsValidConfig)
                {
                    MessageBox.Show("Invalid connection config!", "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                    return;
                }

                RemoveNonLogTabs();
                SuiBotInstance = new SuiBot_Core.SuiBot(connectionConfig, coreConfig);
                SuiBotInstance.OnChannelJoining            += SuiBotInstance_OnChannelJoining;
                SuiBotInstance.OnChannelLeaving            += SuiBotInstance_OnChannelLeaving;
                SuiBotInstance.OnChannelStatusUpdate       += SuiBotInstance_OnChannelStatusUpdate;
                SuiBotInstance.OnChatMessageReceived       += SuiBotInstance_OnChatMessageReceived;
                SuiBotInstance.OnChatSendMessage           += SuiBotInstance_OnChatSendMessage;
                SuiBotInstance.OnIrcFeedback               += SuiBotInstance_OnIrcFeedback;
                SuiBotInstance.OnModerationActionPerformed += SuiBotInstance_OnModerationActionPerformed;
                SuiBotInstance.OnShutdown += SuiBotInstance_OnShutdown;
                IsBotRunning = true;
                MenuItem_BotIsRunning.IsChecked = IsBotRunning;
                UpdateChannelsBranchEnable();
                SuiBotSlaveThread = new Thread(SuiBotInstance.Connect);
                SuiBotSlaveThread.Start();
            }
            else
            {
                SuiBotInstance.Shutdown();
            }
        }
Ejemplo n.º 2
0
        //Cause of course now you have to have Oauth
        public SuiBot_ChannelInstance(string Channel, string Oauth, SuiBot SuiBotInstance, Storage.ChannelConfig ConfigInstance)
        {
            this.Channel                  = Channel;
            this.ConfigInstance           = ConfigInstance;
            this.CoreConfigInstance       = SuiBotInstance.BotCoreConfig;
            this.SuiBotInstance           = SuiBotInstance;
            this.QuotesInstance           = new Components.Quotes(this);
            this.IntervalMessagesInstance = new Components.IntervalMessages(this);
            this.Leaderboards             = new Components.Leaderboards(this);
            this.ChatFiltering            = new Components.ChatFiltering(this);
            this.TwitchStatus             = new TwitchStatusUpdate(this, Oauth);
            this.Cvars         = new Components.CustomCvars(this);
            this.UserCooldowns = new Dictionary <string, DateTime>();
            this.ViewerPb      = new Components.ViewerPB(this);
            this.PCGW          = new Components.PCGW(this, TwitchStatus);
            this.GenericUtil   = new Components.GenericUtil(this, TwitchStatus);

            //Other
            MemeComponents = new Components.Other._MemeComponents(this, ConfigInstance.MemeComponents);
        }
Ejemplo n.º 3
0
        public MainWindow()
        {
            DataContext = this;
            ChannelTabs = new Dictionary <string, RichTextBox>();


            InitializeComponent();
            if (!SuiBot_Core.Storage.ConnectionConfig.ConfigExists())
            {
                var tmpConfig = new SuiBot_Core.Storage.ConnectionConfig();
                tmpConfig.Save();
            }
            IsBotRunning   = false;
            MinimizeToTray = false;
            SuiBotInstance = new SuiBot_Core.SuiBot();

            ReloadActiveChannels();
            RichBox_Log.IsReadOnly = true;
            LogRB_AppendLine(new Run("Welcome to SuiBot V2.")
            {
                Foreground = new SolidColorBrush(Colors.Black)
            });
        }
Ejemplo n.º 4
0
 public ImgUploader(SuiBot botInstance)
 {
     this.botInstance = botInstance;
 }