static void Main(string[] args)
        {
            Authenticator = new WebAuthenticator();
            if (!File.Exists($"{AppDirectory}setupcomplete.txt"))
            {
                FirstTimeSetup();
            }

            // TODO: create json/xml settings file instead of this
            var FileContents = File.ReadAllText($"{AppDirectory}setupcomplete.txt");

            AppState = Guid.Parse(FileContents);

            ConsoleHelper.WriteLine("Grabbing credentials from database...");
            ChatBot = new TwitchChatBot(Authenticator, AppState);
            ConsoleHelper.WriteLine("Connecting to Twitch...");
            ChatBot.Start();

            // TODO: make playlists great again
            ConsoleHelper.WriteLine("Attempting to load the playlist...");
            GlobalVariables.GlobalPlaylist.LoadFromFolder("C:/Users/rocki/OneDrive/Music/STREM III");
            GlobalVariables.GlobalPlaylist.Shuffle();
            GlobalVariables.GlobalPlaylist.Play();

            object      locker     = new object();
            List <char> charBuffer = new List <char>();

            while (ChatBot.IsConnected)
            {
                var key = ConsoleHelper.ReadKey();
            }

            ConsoleHelper.WriteLine("Press any key to exit...");
            System.Console.ReadKey(true);
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            DisableConsoleQuickEdit.Go();

            Authenticator = new WebAuthenticator();
            Settings      = new ApplicationSettings();
            if (!Settings.Exists())
            {
                FirstTimeSetup();
            }
            Settings = Settings.Load();
            GlobalVariables.AppSettings = Settings;

            ConsoleHelper.WriteLine("Grabbing credentials from database...");
            ChatBot = new TwitchChatBot(Authenticator, Settings.AppState, Settings);
            ConsoleHelper.WriteLine("Connecting to Twitch...");
            ChatBot.Start();

            ConsoleHelper.WriteLine("Loading chat timers...");
            MsgTimer = new ChatTimer(ChatBot, 900000);
            if (MsgTimer.Count() > 1)
            {
                ConsoleHelper.WriteLine($"{MsgTimer.Count()} timers loaded.");
            }

            GlobalVariables.GlobalPlaylist.OnSongChanged += OnPlaylistSongChanged;
            if (Settings.PlaylistLocation != null && Directory.Exists(Settings.PlaylistLocation))
            {
                ConsoleHelper.WriteLine("Loading the playlist...");
                GlobalVariables.GlobalPlaylist.LoadFromFolder(Settings.PlaylistLocation);
                GlobalVariables.GlobalPlaylist.Shuffle();
                GlobalVariables.GlobalPlaylist.Play();
            }

            object      locker     = new object();
            List <char> charBuffer = new List <char>();

            while (ChatBot.IsConnected)
            {
                var key = ConsoleHelper.ReadKey();
            }

            ConsoleHelper.WriteLine("Press any key to exit...");
            System.Console.ReadKey(true);
        }