This project is part of my speech recognition console application that can be found at brettanda.ca/projects/friday-discord-bot. I am making this part of the application as part of a failsafe if the speech recognition stops working properly. This command is also run during the startup of the bot and shows the status of the bot while booting.

In Discord you can communicate with this bot by typing commands in any chat that the bot also has access to.

class Program    {        public static Boolean isConvo = false;        public static bool error = false;        static readonly List<string> Websites = new List<string>(new string[] { "brettanda.ca" });        ///<summary>        ///<para>The main startup</para>        ///</summary>        static void Main(string[] args)        {            bool CheckInternetConnection()            {                try                {                    using (var client = new WebClient())                    using (client.OpenRead("https/clients3.google.com"))                    {                        return true;                    }                }                catch                {                    return false;                }            }            Console.Title            bool connection = CheckInternetConnection();            if (connection            {                TypeWriter("Internet Connectivity Status: ");                TypeWriter("Online", ConsoleColor.Green);                Console.WriteLine();            }            else            {                TypeWriter("Internet Connectivity Status: ");                TypeWriter("Offline", ConsoleColor.Red);                Console.WriteLine();                TypeWriter("Check your connection settings", ConsoleColor.Yellow);                Console.WriteLine();            }            TypeWriter("Running on: "            Console.WriteLine();            //Modules.FridaySpeech.Start();            if (connection            {                foreach (string website in Websites)                {                    //ConsoleSpinner spin = new ConsoleSpinner();                    LoadProgress("Working...");                    string web                    /*while (web != "true" && web != "false" && web == "")                    {                        spin.Turn();                    }*/                    if                     {                        TypeWriter(web, ConsoleColor.Yellow);                        Console.WriteLine();                    }                    else if (web                    {                        TypeWriter(website, ConsoleColor.Magenta);                        TypeWriter(" Status: ");                        TypeWriter("Online", ConsoleColor.Green);                        Console.WriteLine();                    }                    else if (web                    {                        TypeWriter(website, ConsoleColor.Magenta);                        TypeWriter(" Status: ");                        TypeWriter("Offline", ConsoleColor.Red);                        Console.WriteLine();                    }                    else                    {                        TypeWriter(web, ConsoleColor.Yellow);                    }                    /*if (CheckWebsiteStatus(website) == true)                    {                        TypeWriter(website + " Status: ");                        Console.ForegroundColor = ConsoleColor.Green;                        TypeWriter("Online");                        Console.ForegroundColor = ConsoleColor.White;                        Console.WriteLine();                    }                    else                    {                        TypeWriter(website + " Status: ");                        Console.ForegroundColor = ConsoleColor.Red;                        TypeWriter("Offline");                        Console.ForegroundColor = ConsoleColor.White;                        Console.WriteLine();                    }*/                }            }            else            {                foreach (string website in Websites)                {                    TypeWriter(website                    TypeWriter("Offline", ConsoleColor.Red);                    Console.WriteLine();                }            }            Modules.FridaySpeech.Start();            TypeWriter("The time is "Format("{0:h:mm:ss tt}", DateTime.Now));            Console.WriteLine();            Modules.FridaySpeech.Begin();            Messages();        }        public static void Messages()        {            string messageReadLine();            bool YorN;            if             {                if (message.ToLower().Contains("friday")                {                    Random randwhat = new Random();                    int indexwNext(Modules.Variables.WhatUp.Count);                    SendMessage(Uppercasefirst(Modules.Variables.WhatUp[indexw]), message);                    Messages();                }                foreach (string greet in Modules.Variables.Greetings)                {                    if (message.ToLower().Contains(greet)                    {                        SendMessage(Uppercasefirst(greet), message);                        Messages();                    }                }                foreach (string fare in Modules.Variables.Farewells)                {                    if (message.ToLower().Contains(fare)                    {                        SendMessage(Uppercasefirst(fare), message);                        Messages();                    }                }                foreach (string thank in Modules.Variables.Thanks)                {                    if (message.ToLower().Contains(thank)                    {                        Random randthank = new Random();                        int indextNext(Modules.Variables.Thanks.Count);                        SendMessage(Uppercasefirst(Modules.Variables.Thanks[indext]), message);                        Messages();                    }                }                if (message.ToLower().Contains("time"Question(message)                {                    SendMessage(Uppercasefirst("the time is "Format("{0:hh:mm:ss tt}", DateTime.Now)), message);                    Messages();                }                if                 {                    SendMessage(Uppercasefirst("are you sure?"), message);                    YorN                    if (YorN                    {                        Environment.Exit(0);                    }                    else if (YorN                    {                        SendMessage(Uppercasefirst("YAY"), message);                        Messages();                    }                }                if (message.ToLower().Contains("start voice"))                {                    FridayAI.Modules.FridaySpeech.Begin();                }                if (message.ToLower().Contains("stop voice"))                {                    Modules.FridaySpeech.Stop();                }                if (message.ToLower().Contains("add"                {                    Modules.Google.AddEvent("test", "test");                    SendMessage(Uppercasefirst("event added"), message);                    Messages();                }                if (message.ToLower().Contains("is hurt"))                {                    SendMessage(Uppercasefirst("was it something that you did?"), message);                    YorN                    if (YorN                    {                        SendMessage(Uppercasefirst("do you know what you did?"), message);                        YorN                        if (YorN                        {                            //SendMessage(Uppercasefirst("talk to her about it, and make her feel better."), message);                            SendMessage(Uppercasefirst("are you with her right now?"), message);                            YorN                            if(YorN                            {                                SendMessage(Uppercasefirst("have you tried anything physical like a hug or trying to hold her hand?"), message);                                YorN                                if (YorN                                {                                }                                else                                {                                    SendMessage(Uppercasefirst("have you tried talking to her?"), message);                                    YorN                                    if (YorN                                    {                                    }                                    else                                    {                                        SendMessage(Uppercasefirst("?"), message);                                        YorN                                        if (YorN                                        {                                        }                                        else                                        {                                        }                                    }                                }                            }                            else                            {                                SendMessage(Uppercasefirst("Are you in a call with her, or are you able to talk to her?"), message);                                YorN                                if (YorN                                {                                    SendMessage(Uppercasefirst("?"), message);                                    YorN                                    if (YorN                                    {                                    }                                    else                                    {                                    }                                }                                else                                {                                    SendMessage(Uppercasefirst("?"), message);                                    YorN                                    if (YorN                                    {                                    }                                    else                                    {                                    }                                }                            }                        }                        else if (YorN                        {                            SendMessage(Uppercasefirst("have you already asked what you have done?"), message);                            YorN                            if (YorN                            {                                SendMessage(Uppercasefirst("first, don't ask anymore but don't forget what the answer was when you did ask."), message);                                Messages();                            }                            else if (YorN                            {                                SendMessage(Uppercasefirst("ask her immediately and remember the answer. Then you better make sence of it."), message);                                Messages();                            }                        }                    }                    else if (YorN                    {                        SendMessage(Uppercasefirst("did someone else do it?"), message);                        YorN                        if (YorN                        {                            SendMessage(Uppercasefirst("were you able to prevent this thing from happening?"), message);                            YorN                            if (YorN                            {                                SendMessage(Uppercasefirst(""), message);                            }                            else if (YorN                            {                                SendMessage(Uppercasefirst("was this something you were able to take action after it had happened?"), message);                                YorN                                if (YorN                                {                                    SendMessage(Uppercasefirst("is there something that you can still do to fix what you should have done ealier?"), message);                                    YorN                                    if (YorN                                    {                                        SendMessage(Uppercasefirst("find what you can do to help and do it before this gets worse."), message);                                        Messages();                                    }                                    else if (YorN                                    {                                    }                                }                                else if (YorN                                {                                }                            }                        }                        else if (YorN                        {                            SendMessage(Uppercasefirst("did she do something to her self?"), message);                            YorN                            if (YorN                            {                            }                            else if (YorN                            {                            }                        }                    }                }                if (message.ToLower().Contains("message"))                {                    SendNotification("title", "message");                    Messages();                }                error                SendMessage(Uppercasefirst("i don't know how to repond to that, sorry."), message);                error            }            Messages();        }        /*public class ConsoleSpinner        {            int counter;            public ConsoleSpinner()            {                counter = 0;            }            public void Turn()            {                counter++;                if(counter == 0)                {                    Console.Write("/");                }else if(counter == 1)                {                    Console.Write("-");                }else if(counter == 2)                {                    Console.Write("\\");                }else if(counter == 3)                {                    Console.Write("|");                }                else                {                    counter = 0;                }                Console.SetCursorPosition(Console.CursorLeft - 1, Console.CursorTop);            }        }*/        public static void LoadProgress(string message)        {            TypeWriter(message, ConsoleColor.Yellow);            Console.SetCursorPosition(Console.CursorLeft        }        public static int PickIndex(List<string> list)        {            Random randList = new Random();            int iNext(0, list.Count);            return i;        }        public static bool GetYorN()        {            ConsoleKey response;            do            {                /*while (Console.KeyAvailable)                    Console.ReadKey();*/                Console.Write("Y or N? ");                response                Console.WriteLine();            } while (response            return response        }        public static void TypeWriter(string message, ConsoleColor begin  10)        {            message            Console.ForegroundColor            for (int i            {                Console.Write(message[i]);                System.Threading.Thread.Sleep(SpeedMilisecond);            }            Console.ForegroundColor        }        public static string CheckWebsiteStatus(string url)        {            try            {                var ping = new System.Net                var resultSend(url);                if (result.Status                {                    return "true";                }                else                {                    return "false";                }            }            catch (Exception e)            {                return e.Message;                //return e.message;            }        }        public static void SendMessage(string message, string usermsg)        {            if (Question(usermsg)            {                TypeWriter("Q ", ConsoleColor.Green);            }            else            {                TypeWriter("Q ", ConsoleColor.Yellow);            }            TypeWriter("Friday:", ConsoleColor.Cyan);            if (error            {                TypeWriter(" "            }            else            {                TypeWriter(" "            }            Console.WriteLine("");        }        public static void Convorsation(Boolean convo)        {            if (convo            {                isConvo            }            else            {                isConvo            }        }        public static void SendNotification(string title, string message)        {            Console.WriteLine("Notification not sent");        }        public static string TimeOfDay()        {            if (DateTime.Now.Hour            {                return "night";            }            else if (DateTime.Now.Hour            {                return "morning";            }            else if (DateTime.Now.Hour            {                return "afternoon";            }            else if (DateTime.Now.Hour            {                return "evening";            }            else            {                return "day";            }        }        public static Boolean IsOwnWord(string word, string Content)        {            if (Content.Length            {                //the message only contains the word or phrase                return true;            }            else            {                if (" ") || "-") || Contains("-" +                 {                    //the message contains the word/phrase but is hase more than just the word or phrase                    return true;                }                else { return false; }            }        }        public static string Uppercasefirst(string s)        {            if (string.IsNullOrEmpty(s))            {                return string.Empty;            }            char[] aToCharArray();            a[0            return new string(a);        }        public static Boolean Question(string Message)        {            Message            if (Message.Contains("what"            {                return true;            }            else            {                return false;            }        }        /*SendMessage(Uppercasefirst("test Y or N?"),message);        YorN = GetYorN();        if(YorN == true)        {            SendMessage(Uppercasefirst(""), message);            Messages();        }else if(YorN == false)        {            SendMessage(Uppercasefirst(""), message);            Messages();        }*/        /*SendMessage(Uppercasefirst("did someone else do it?"), message);        message = Console.ReadLine();        if (message.ToLower().Contains("yes"))        {        }else if (message.ToLower().Contains("no"))        {        }        else        {        }*/    }