Esempio n. 1
0
        public async Task <ActionResult <Pastebin> > PostPastebin(Pastebin pastebin)
        {
            if (pastebin.code == null)
            {
                return(BadRequest("code is missing"));
            }

            if (pastebin.type == null)
            {
                return(BadRequest("type is missing"));
            }

            pastebin.key = RandomString(7);

            var pastebinExist = await _context.Pastebins.FindAsync(pastebin.key);

            if (pastebinExist != null)
            {
                return(BadRequest(new { message = "Pastebin already exist" }));
            }

            _context.Pastebins.Add(pastebin);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetPastebin", new { id = pastebin.key }, pastebin));
        }
        public Pastebin AddPastebin(Pastebin pastebin)
        {
            _context.Pastebins.Add(pastebin);
            _context.SaveChanges();

            return(pastebin);
        }
Esempio n. 3
0
        public ActionResult Index(string name = "", string message = "")
        {
            Pastebin ps = new Pastebin();

            ps.Code = "";
            ps.Name = "";

            name = Regex.Replace(name, "[^a-zA-Z0-9_.]+", "", RegexOptions.Compiled);
            name = name.ToLower();
            if (name.Length == 0)
            {
                return(View(ps));
            }

            var    ps2 = db.Pastebin.Find(name);
            string k   = name;
            int    i   = 0;

            while (ps2 != null)
            {
                k   = name;
                k  += i.ToString();
                ps2 = db.Pastebin.Find(k);
                i++;
            }


            ps.Code = message;
            ps.Name = k;
            db.Pastebin.Add(ps);
            db.SaveChanges();
            return(View("~/Views/Home/Code.cshtml", ps));
        }
        public void PastebinLogin()
        {
            if (Config.PastebinSettings != null)
            {
                try
                {
                    Pastebin pastebin = new Pastebin(APIKeys.PastebinKey, Config.PastebinSettings);

                    if (pastebin.Login())
                    {
                        UpdatePastebinStatus();
                        MessageBox.Show(Resources.UploadersConfigForm_Login_successful, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        UpdatePastebinStatus();
                        MessageBox.Show(Resources.UploadersConfigForm_Login_failed, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                catch (Exception ex)
                {
                    ex.ShowError();
                }
            }
        }
Esempio n. 5
0
 public PasteBinService(IOptions <PastBinOptions> pasteBinOptions, ILoggerFactory loggerFactory)
 {
     _pasteBinOptions = pasteBinOptions?.Value;
     Pastebin.DevKey  = _pasteBinOptions.UserKey;
     _me     = Pastebin.LoginAsync(_pasteBinOptions.UserName, _pasteBinOptions.Password).GetAwaiter().GetResult();
     _logger = loggerFactory.CreateLogger(typeof(PasteBinService));
 }
Esempio n. 6
0
        public async Task GetLog()
        {
            try
            {
                var user = Context.User;
                if (!Helper.IsOwner(user))
                {
                    await ReplyAsync("Sorry, but you're not allowed to use that super premium command!");

                    return;
                }

                IMessage message = await ReplyAsync("One sec..");

                string file = Path.Combine(Information.Directory, "log.txt");
                string log  = File.ReadAllText(file);
                //upload to pastebin
                string link = await Pastebin.Post(log);

                var dm = await user.GetOrCreateDMChannelAsync();

                await dm.SendMessageAsync($"Here you go <{link}>");

                await message.DeleteAsync();

                ConsoleHelper.Log($"{Context.User} requested the bot log!", LogSeverity.Info);
            } catch (Exception ex)
            {
                await ReplyAsync(
                    "Whoops, unfortunately I couldn't send you the log.. I think it's a faulty API key :confused:");

                ConsoleHelper.Log($"Error sending log, {ex.Message}!", LogSeverity.Error);
            }
        }
Esempio n. 7
0
        public async Task <Paste> CreateBinAsync(string message)
        {
            var user = await Pastebin.LoginAsync("grzegorzmuraczewski", "password"); // TODO remove harcoded values

            var paste = await user.CreatePasteAsync(message);

            return(paste);
        }
Esempio n. 8
0
        static async Task PastebinExample()
        {
            //before using any class in the api you must enter your api dev key
            Pastebin.DevKey = "your dev key goes here";
            //you can see yours here: https://pastebin.com/api#1
            try
            {
                // login and get user object
                User me = await Pastebin.LoginAsync("user", "pass");

                // user contains information like e-mail, location etc...
                Console.WriteLine("{0}({1}) lives in {2}", me, me.Email, me.Location);
                // lists all pastes for this user
                foreach (Paste paste in await me.ListPastesAsync(3)) // we limmit the results to 3
                {
                    Console.WriteLine(paste.Title);
                }

                string code = "<your fancy &code#() goes here>";
                //creates a new paste and get paste object
                Paste newPaste = await me.CreatePasteAsync(code, "MyPasteTitle", Language.HTML5, Visibility.Public, Expiration.TenMinutes);

                //newPaste now contains the link returned from the server
                Console.WriteLine("URL: {0}", newPaste.Url);
                Console.WriteLine("Paste key: {0}", newPaste.Key);
                Console.WriteLine("Content: {0}", newPaste.Text);
                //deletes the paste we just created
                await me.DeletePasteAsync(newPaste);

                //lists all currently trending pastes(similar to me.ListPastes())
                foreach (Paste paste in await Pastebin.ListTrendingPastesAsync())
                {
                    Console.WriteLine("{0} - {1}", paste.Title, paste.Url);
                }
                //you can create pastes directly from Pastebin static class but they are created as guests and you have a limited number of guest uploads
                Paste anotherPaste = await Paste.CreateAsync("another paste", "MyPasteTitle2", Language.CSharp, Visibility.Unlisted, Expiration.OneHour);

                Console.WriteLine(anotherPaste.Title);
            }
            catch (PastebinException ex) //api throws PastebinException
            {
                //in the Parameter property you can see what invalid parameter was sent
                //here we check if the exeption is thrown because of invalid login details
                if (ex.Parameter == PastebinException.ParameterType.Login)
                {
                    Console.Error.WriteLine("Invalid username/password");
                }
                else
                {
                    throw; //all other types are rethrown and not swalowed!
                }
            }
            Console.ReadKey();
        }
        public static async Task <Boolean> TryLogInAsync(String username, String password)
        {
            PastebinHelper.ApplyDevKey();
            try
            {
                CurrentUser = await Pastebin.LoginAsync(username, password);

                return(true);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message, PastebinHelper.DefaultCaption);
                return(false);
            }
        }
Esempio n. 10
0
        private async Task Client_Ready(ReadyEventArgs e)
        {
            Pastebin.DevKey = this.DevKey;
            try
            {
                User = await Pastebin.LoginAsync(Username, Pass);

                Console.WriteLine("Pastebin service ready!");
            }
            catch (PastebinException ex)
            {
                if (ex.Parameter == PastebinException.ParameterType.Login)
                {
                    Console.Error.WriteLine("Invalid username/password");
                }
            }
        }
Esempio n. 11
0
        public UploadResult UploadText(Stream stream, string fileName)
        {
            TextUploader textUploader = null;

            switch (Info.TaskSettings.TextDestination)
            {
            case TextDestination.Pastebin:
                PastebinSettings settings = Program.UploadersConfig.PastebinSettings;
                if (string.IsNullOrEmpty(settings.TextFormat))
                {
                    settings.TextFormat = Info.TaskSettings.AdvancedSettings.TextFormat;
                }
                textUploader = new Pastebin(APIKeys.PastebinKey, settings);
                break;

            case TextDestination.PastebinCA:
                textUploader = new Pastebin_ca(APIKeys.PastebinCaKey, new PastebinCaSettings {
                    TextFormat = Info.TaskSettings.AdvancedSettings.TextFormat
                });
                break;

            case TextDestination.Paste2:
                textUploader = new Paste2(new Paste2Settings {
                    TextFormat = Info.TaskSettings.AdvancedSettings.TextFormat
                });
                break;

            case TextDestination.Slexy:
                textUploader = new Slexy(new SlexySettings {
                    TextFormat = Info.TaskSettings.AdvancedSettings.TextFormat
                });
                break;

            case TextDestination.Pastee:
                textUploader = new Pastee {
                    Lexer = Info.TaskSettings.AdvancedSettings.TextFormat
                };
                break;

            case TextDestination.Paste_ee:
                textUploader = new Paste_ee(Program.UploadersConfig.Paste_eeUserAPIKey);
                break;

            case TextDestination.Gist:
                textUploader = Program.UploadersConfig.GistAnonymousLogin
                        ? new Gist(Program.UploadersConfig.GistPublishPublic)
                        : new Gist(Program.UploadersConfig.GistPublishPublic, Program.UploadersConfig.GistOAuth2Info);
                break;

            case TextDestination.Upaste:
                textUploader = new Upaste(Program.UploadersConfig.UpasteUserKey)
                {
                    IsPublic = Program.UploadersConfig.UpasteIsPublic
                };
                break;

            case TextDestination.CustomTextUploader:
                if (Program.UploadersConfig.CustomUploadersList.IsValidIndex(Program.UploadersConfig.CustomTextUploaderSelected))
                {
                    textUploader = new CustomTextUploader(Program.UploadersConfig.CustomUploadersList[Program.UploadersConfig.CustomTextUploaderSelected]);
                }
                break;
            }

            if (textUploader != null)
            {
                PrepareUploader(textUploader);
                return(textUploader.UploadText(stream, fileName));
            }

            return(null);
        }
Esempio n. 12
0
 public async Task ListTrendingPastesAsync() => await Pastebin.ListTrendingPastesAsync();
Esempio n. 13
0
 public static PastebinCreatedDTO CreateFromPastebin(Pastebin pastebin)
 {
     return(new PastebinCreatedDTO(pastebin));
 }
Esempio n. 14
0
 private PastebinCreatedDTO(Pastebin pastebin)
 {
     Id           = pastebin.Id;
     GeneratedUrl = $"/pastebin/{pastebin.Id}";
 }
Esempio n. 15
0
 public static PastebinToBeViewedDTO FromPastebinAndContent(Pastebin pastebin, string content)
 {
     return(new PastebinToBeViewedDTO(pastebin, content));
 }
Esempio n. 16
0
 private PastebinToBeViewedDTO(Pastebin pastebin, string content)
 {
     Content        = content;
     ExpirationDate = pastebin.ExpirationDate;
     CreationDate   = pastebin.CreationDate;
 }
Esempio n. 17
0
        internal void RespondToChatEvent(Event chatEvent)
        {
            #region Bot Logic
            // Logic for responding to a "PRIVMSG" event
            if (chatEvent.GetType().Equals(typeof(ChatEvent)))
            {
                // Create a reference for the chat data
                ChatEvent chatData    = (ChatEvent)(chatEvent);
                string    message     = chatData.ChatMessage;
                string    user        = chatData.User;
                string    channelName = chatData.Channel;

                Program.nutbotty.Invoke(new Action(() =>
                {
                    Program.nutbotty.chatBox.Text += string.Format("<{0}> {1}" + Environment.NewLine, user, message);
                }));

                #region JOIN and PART commands
                if (message.Equals("!join") && channelName.Equals(Program.BOTNAME))
                {
                    Log.Message(user + " requested " + Program.BOTNAME + " to join their channel.", true);
                    if (!DatabaseHandler.ChannelExists(user))
                    {
                        Channel channel = new Channel(user);
                        DatabaseHandler.InsertChannel(channel);
                        new TwitchChatRoom(chatConnection, whisperConnection, channel);
                        SendChatMessage(Program.BOTNAME + " is now available for " + user + ". Type !commands for a list of commands you can use.");
                    }
                    else
                    {
                        SendChatMessage(Program.BOTNAME + " is already available for " + user + ".");
                    }
                }

                if (message.Equals("!part") && channelName.Equals(Program.BOTNAME))
                {
                    Log.Message(user + " requested " + Program.BOTNAME + " to part their channel.", true);
                    if (DatabaseHandler.ChannelExists(user))
                    {
                        Channel channel = new Channel(user);
                        DatabaseHandler.DeleteChannel(channel.channelName);
                        chatConnection.part(user);
                        SendChatMessage("@" + user + ", thank you for using " + Program.BOTNAME + ".Type !join if you ever want to use " + Program.BOTNAME + " again.");
                    }
                    else
                    {
                        SendChatMessage(Program.BOTNAME + " is not in #" + user + ".");
                    }
                }
                #endregion

                #region Generic Commands
                // Iterate through table rows in database and check if the trigger text matches the message
                for (int i = 0; i < DatabaseHandler.CommandsCount(); i++)
                {
                    //Retrieve command from the database and replace the appropriate strings
                    ChatCommand command = DatabaseHandler.GetCommandAtIndex(i);

                    string responseText = command.ResponseText;
                    responseText = responseText.Replace("$channel", channelName);
                    responseText = responseText.Replace("$user", user);

                    // Check if the command needs to be matched exactly or "loosely"
                    if ((command.MustBeExact && message.Equals(command.TriggerText)) || (!command.MustBeExact && message.Contains(command.TriggerText)))
                    {
                        // Check if the command is universal, or if the command is in the correct channel
                        if (command.IsUniversal || channelName.Equals(command.ChannelName))
                        {
                            // Check if the user is the subscriber (iff the command is subscriber only)
                            if ((command.SubscriberOnly && chatData.UserIsSubscriber) || !(command.SubscriberOnly))
                            {
                                // Check if the user is the moderator (iff the command is moderator only)
                                if ((command.ModeratorOnly && chatData.UserIsModerator) || !(command.ModeratorOnly))
                                {
                                    // Check if the user is the broadcaster (iff the command is broadcaster only)
                                    if ((command.BroadcasterOnly && chatData.UserIsBroadcaster) || !(command.BroadcasterOnly))
                                    {
                                        // Check if the command is whisper only
                                        if (command.WhisperResponse)
                                        {
                                            SendWhisper(user, responseText);
                                        }
                                        else
                                        {
                                            SendChatMessage(responseText);
                                        }
                                    }
                                    else
                                    {
                                        SendWhisper(user, command.TriggerText + " is only available to the broadcaster.");
                                    }
                                }
                                else
                                {
                                    SendWhisper(user, command.TriggerText + " is only available to moderators.");
                                }
                            }
                            else
                            {
                                SendWhisper(user, command.TriggerText + " is only available to subscribers.");
                            }
                        }
                    }
                }
                #endregion

                #region BLOCKED PHRASE Commands
                for (int i = 0; i < DatabaseHandler.PhraseCount(); i++)
                {
                    string phrase = DatabaseHandler.GetPhraseAtIndex(i).phrase;
                    if (message.Contains(phrase))
                    {
                        if (!chatData.UserIsModerator)
                        {
                            SendChatMessageNoAction(".timeout " + user + " 1");
                            SendWhisper(user, "Your messages have been purged from " + channelName + " for using the phrase \"" + phrase + "\".");
                            Log.Message(user + " has been timed out from " + channelName + " for using the phrase \"" + phrase + "\".", true);
                        }
                    }
                }

                // Add a phrase to the BLOCKED_PHRASES table
                if (message.StartsWith("!block "))
                {
                    // Parse the phrase text data
                    string phrase_text = message.Substring("!block ".Length);

                    // If the user is a moderator, add the quote to the database, else do nothing
                    if (chatData.UserIsModerator)
                    {
                        // Assume the command has no arguments, then split on space characters
                        bool     hasArgs = false;
                        string[] args    = message.Split(' ');

                        // If there is at least one argument, continue, otherwise end if
                        if (args.Length > 1)
                        {
                            hasArgs = true;
                        }
                        else
                        {
                            Log.Message("<" + channelName + "> " + user + " attempted to block phrase, but there was not enough arguments.", true);
                        }
                        // Add phrase to database if there were arguments and phrase doesn't already exist in the database
                        if (hasArgs)
                        {
                            if (DatabaseHandler.PhraseExists(phrase_text))
                            {
                                SendChatMessage(user + ", the phrase \"" + phrase_text + "\" is already blocked.");
                                Log.Message("<" + channelName + "> " + user + " attempted to block a phrase, but it already exists --> " + phrase_text, true);
                            }
                            else
                            {
                                BlockedPhrase phrase = new BlockedPhrase(phrase_text);
                                DatabaseHandler.InsertPhrase(phrase);
                                SendChatMessage(user + " blocked the phrase [" + (DatabaseHandler.PhraseCount() - 1) + "]: " + phrase_text);
                                Log.Message("<" + channelName + "> " + user + " blocked a phrase: " + phrase_text, true);
                            }
                        }
                    }
                    else
                    {
                        SendWhisper(user, "!block is only available to moderators");
                        Log.Message(user + " attempted to block a phrase but is not a moderator --> " + phrase_text, true);
                    }
                }

                // Delete a quote to the QUOTE table by searching the QuoteText column
                if (message.StartsWith("!unblock "))
                {
                    // Parse the quote text data
                    string phrase_text = message.Substring("!unblock ".Length);

                    // If the user is a moderator, add the quote to the database, else do nothing
                    if (chatData.UserIsModerator)
                    {
                        // Assume the command has no arguments
                        bool hasArgs = false;
                        // Split the command on space characters
                        string[] args = message.Split(' ');
                        // If there is at least one argument, continue, otherwise end if
                        if (args.Length > 1)
                        {
                            hasArgs = true;
                        }
                        else
                        {
                            Log.Message("<" + channelName + "> " + user + " attempted to unblock a phrase, but there was not enough arguments.", true);
                        }
                        // Add quote to database if there were arguments and the quote exists
                        if (hasArgs)
                        {
                            if (DatabaseHandler.PhraseExists(phrase_text))
                            {
                                DatabaseHandler.DeletePhrase(phrase_text);
                                SendChatMessage(user + " unblocked a phrase: " + phrase_text);
                                Log.Message("<" + channelName + "> " + user + " unblocked a phrase: " + phrase_text, true);
                            }
                            else
                            {
                                SendChatMessage(user + ", that phrase is already unblocked.");
                                Log.Message("<" + channelName + "> " + user + " attempted to block a phrase, but it does not exist --> " + phrase_text, true);
                            }
                        }
                    }
                    else
                    {
                        SendWhisper(user, "!unblock is only available to moderators");
                        Log.Message(user + " attempted to unblock a phrase but is not a moderator --> " + phrase_text, true);
                    }
                }
                #endregion

                #region QUOTE Commands
                // Pull a random quote from the QUOTES table
                Regex quoteRgx    = new Regex(@"^!quote$");
                Regex quoteNumRgx = new Regex(@"^!quote [0-9]{1,}$");
                Quote foundQuote;

                if (quoteRgx.IsMatch(message))
                {
                    int ID = RNG.Next(0, DatabaseHandler.QuoteCount());
                    foundQuote = DatabaseHandler.GetQuoteAtIndex(ID);
                    Log.Message(user + " requested a random quote from the database.", true);
                    SendChatMessage(string.Format("[{0}] {1}", ID, foundQuote.quoteText));
                }
                else if (quoteNumRgx.IsMatch(message))
                {
                    string quoteNum = message.Remove(0, "!quote ".Length);
                    int    ID       = Convert.ToInt32(quoteNum);

                    if (ID >= 0 && ID < DatabaseHandler.QuoteCount())
                    {
                        foundQuote = DatabaseHandler.GetQuoteAtIndex(ID);
                        Log.Message(user + " requested for quote #" + ID + " from the database.", true);
                        SendChatMessage(string.Format("[{0}] {1}", ID, foundQuote.quoteText));
                    }
                    else
                    {
                        SendWhisper(user, "There are only " + DatabaseHandler.QuoteCount() + " quotes in the database.");
                    }
                }
                else if (message.StartsWith("!quote "))
                {
                    string       searchString = message.Remove(0, "!quote ".Length);
                    List <Quote> result       = DatabaseHandler.SearchQuoteList(searchString);

                    if (result.Count > 0)
                    {
                        int ID = RNG.Next(0, result.Count);
                        foundQuote = result[ID];
                        Log.Message(user + " searched quote from the database.", true);
                        SendChatMessage(string.Format("{0}", foundQuote.quoteText));
                    }
                    else
                    {
                        SendWhisper(user, string.Format("The phease '{0}' was not found in the database.", searchString));
                    }
                }

                // Add a quote to the QUOTE table
                if (message.StartsWith("!addquote "))
                {
                    // Parse the quote text data
                    string quoteText = message.Substring("!addquote ".Length);
                    Quote  quote     = new Quote(quoteText, channelName, user, DateTime.Now);

                    // If the user is a moderator, add the quote to the database, else do nothing
                    if (chatData.UserIsModerator)
                    {
                        // Assume the command has no arguments, then split on space characters
                        bool     hasArgs = false;
                        string[] args    = message.Split(' ');

                        // If there is at least one argument, continue, otherwise end if
                        if (args.Length > 1)
                        {
                            hasArgs = true;
                        }
                        else
                        {
                            Log.Message("<" + channelName + "> " + user + " attempted to add quote, but there was not enough arguments.", true);
                        }
                        // Add quote to database if there were arguments and quote doesn't already exist in the database
                        if (hasArgs)
                        {
                            if (DatabaseHandler.QuoteExists(quoteText))
                            {
                                SendChatMessage(user + ", that quote is already in the database.");
                                Log.Message("<" + channelName + "> " + user + " attempted to add quote, but it already exists --> " + quoteText, true);
                            }
                            else
                            {
                                DatabaseHandler.InsertQuote(quote);
                                quoteListHasChanges = true;
                                SendChatMessage(user + " added quote [" + (DatabaseHandler.QuoteCount() - 1) + "]: " + quoteText);
                                Log.Message("<" + channelName + "> " + user + " added quote: " + quoteText, true);
                            }
                        }
                    }
                    else
                    {
                        SendWhisper(user, "!addquote is only available to moderators");
                        Log.Message(user + " attempted to add a quote but is not a moderator --> " + quoteText, true);
                    }
                }

                // Delete a quote to the QUOTE table by searching the QuoteText column
                if (message.StartsWith("!delquote "))
                {
                    // Parse the quote text data
                    string quoteText = message.Substring("!delquote ".Length);

                    // If the user is a moderator, add the quote to the database, else do nothing
                    if (chatData.UserIsModerator)
                    {
                        // Assume the command has no arguments
                        bool hasArgs = false;
                        // Split the command on space characters
                        string[] args = message.Split(' ');
                        // If there is at least one argument, continue, otherwise end if
                        if (args.Length > 1)
                        {
                            hasArgs = true;
                        }
                        else
                        {
                            Log.Message("<" + channelName + "> " + user + " attempted to delete a quote, but there was not enough arguments.", true);
                        }
                        // Add quote to database if there were arguments and the quote exists
                        if (hasArgs)
                        {
                            if (DatabaseHandler.QuoteExists(quoteText))
                            {
                                DatabaseHandler.DeleteQuote(quoteText);
                                quoteListHasChanges = true;
                                SendChatMessage(user + " deleted quote: " + quoteText);
                                Log.Message("<" + channelName + "> " + user + " deleted quote: " + quoteText, true);
                            }
                            else
                            {
                                SendChatMessage(user + ", that quote was not found in the database.");
                                Log.Message("<" + channelName + "> " + user + " attempted to deleted quote, but it does not exist --> " + quoteText, true);
                            }
                        }
                    }
                    else
                    {
                        SendWhisper(user, "!delquote is only available to moderators");
                        Log.Message(user + " attempted to add a quote but is not a moderator --> " + quoteText, true);
                    }
                }

                if (message.Equals("!quotelist"))
                {
                    if (quoteListHasChanges || currenQuotePasteBin.Equals(null))
                    {
                        string pastebinTitle   = Program.BOTNAME + " quote list as of " + DateTime.Now;
                        string pastebinContent = "";

                        List <Quote> quoteList = DatabaseHandler.GetQuoteList();

                        for (int i = 0; i < quoteList.Count; i++)
                        {
                            pastebinContent += "[" + i + "] " + quoteList[i].quoteText + Environment.NewLine;
                        }

                        quoteListHasChanges = false;
                        currenQuotePasteBin = "Click here for a list of quotes ➤ " + Pastebin.Post(pastebinTitle, pastebinContent).Result;
                        SendChatMessage(currenQuotePasteBin);
                    }
                    else
                    {
                        SendChatMessage(currenQuotePasteBin);
                    }
                }
                #endregion

                #region STRAWPOLL Parser
                if (message.Contains("strawpoll.me/"))
                {
                    if (StrawpollParser.GetStrawpollInfo(message) == null)
                    {
                        SendChatMessage(user + ", that is not a valid Strawpoll");
                    }
                    else
                    {
                        SendChatMessage(user + " pasted a Strawpoll ➤ " + StrawpollParser.GetStrawpollInfo(message));
                    }
                }
                #endregion

                #region YOUTUBE Parser
                if (message.Contains("youtube.com/") || message.Contains("youtu.be/"))
                {
                    Console.WriteLine("YouTube Link detected: " + message);
                    if (YouTubeParser.GetYouTubeVideoID(message) != null)
                    {
                        SendChatMessage(user + " pasted a YouTube video ➤ " + YouTubeParser.GetYouTubeInfo(message, YouTubeParser.IS_VIDEO));
                    }
                    if (YouTubeParser.GetYouTubePlaylistID(message) != null)
                    {
                        SendChatMessage(user + " pasted a YouTube playlist ➤ " + YouTubeParser.GetYouTubeInfo(message, YouTubeParser.IS_PLAYLIST));
                    }
                }
                #endregion

                #region GUESSING Commands
                // CeresBot Guesses
                if (message.Contains(@"Round Started. Type !guess") && user.Equals("ceresbot"))
                {
                    int seed = RNG.Next(100);

                    // 30% chance of 45 seconds | 65% chance of 46 seconds | 5% chance of 47 seconds
                    int seconds;
                    if (seed < 30)
                    {
                        seconds = 45;
                    }
                    else if (seed < 95)
                    {
                        seconds = 46;
                    }
                    else
                    {
                        seconds = 47;
                    }

                    // if 45-46 seconds, milliseconds between 0-99, else between 0-25
                    int milliseconds;
                    if (seconds < 47)
                    {
                        milliseconds = RNG.Next(100);
                    }
                    else
                    {
                        milliseconds = RNG.Next(25);
                    }

                    // Make the guess
                    SendChatMessageNoAction("!guess " + seconds + "\"" + milliseconds.ToString("00"));
                }

                // Phantoon guesses
                if (message.Equals("!phantoon"))
                {
                    int[]  rands = new int[2];
                    string label = null;
                    int    total = 0;

                    // Calculate prediction
                    for (int i = 0; i < rands.Length; i++)
                    {
                        rands[i] = RNG.Next(1, 4);
                        total   += rands[i];
                        if (rands[i] == 1)
                        {
                            label = label + " FAST";
                        }
                        else if (rands[i] == 2)
                        {
                            label = label + " MID";
                        }
                        else
                        {
                            label = label + " SLOW";
                        }
                    }

                    // Send chat message
                    if (total <= 2)
                    {
                        SendChatMessage("predicts " + label + ". THE RNG LORDS ARE WITH US PogChamp");
                    }
                    else if (total > 2 && total <= 3)
                    {
                        SendChatMessage("predicts " + label + ". Praise Jesus BloodTrail");
                    }
                    else if (total > 3 && total <= 4)
                    {
                        SendChatMessage("predicts " + label + ". Maybe this won't be a reset after all OMGScoots");
                    }
                    else if (total > 5 && total <= 6)
                    {
                        SendChatMessage("predicts " + label + ". Phantoon please BibleThump");
                    }
                    else if (total == 6)
                    {
                        SendChatMessage("predicts " + label + ". You m**********r. RESET RESET RESET SwiftRage");
                    }
                }

                // Eyedoor guesses
                if (message.Equals("!eyedoor"))
                {
                    int rand = RNG.Next(0, 5);

                    // Send chat message
                    if (rand == 0)
                    {
                        SendChatMessage("predicts... ZERO beams. THE RNG GODS ARE WITH YOU PogChamp");
                    }
                    else if (rand == 1)
                    {
                        SendChatMessage("predicts... ONE beam. Allelujah! BloodTrail");
                    }
                    else if (rand == 2)
                    {
                        SendChatMessage("predicts... TWO beams. You're lucky this time OMGScoots");
                    }
                    else if (rand == 3)
                    {
                        SendChatMessage("predicts... THREE beams. Come on eye door! DansGame");
                    }
                    else if (rand == 4)
                    {
                        SendChatMessage("predicts... FOUR beams. DAFUQ BITCH?! SwiftRage");
                    }
                }
                #endregion

                #region OTHER Commands
                // Show the uptime for the stream. Information is pulled from DecAPI API by Alex Thomassen
                if (message.Equals("!uptime"))
                {
                    string uptime = GetUptime(chatData.Channel);
                    SendChatMessage("@" + user + ": " + uptime);
                    Log.Message(user + " checked the uptime for #" + chatData.Channel + ": " + uptime, true);
                }

                // Check how many points Nutbotty has on ceresbot
                if (message.Contains(Program.BOTNAME) && message.Contains("how many points") && channelName.Equals("oatsngoats"))
                {
                    SendChatMessageNoAction("!points");
                }

                // Commit sudoku
                if (message.Equals("!sudoku"))
                {
                    if (!chatData.UserIsModerator)
                    {
                        SendChatMessageNoAction(".timeout " + user + " 1");
                        SendChatMessage(user + " committed sudoku.");
                    }
                }

                if (message.Equals("!foosdaraid"))
                {
                    for (int i = 0; i < 5; i++)
                    {
                        SendChatMessage("Foosda Raid ( ͡° ͜ʖ ͡°)");
                    }
                }

                // Block thinking emoji
                if (message.Equals("🤔"))
                {
                    SendChatMessageNoAction(".timeout " + user + " 1");
                    SendWhisper(user, "Your messages have been purged from " + channelName + " for using the thinking emoji. Go sit in the corner.");
                    Log.Message(user + " has been timed out from " + channelName + " for using the thinking emoji. Go sit in the corner.", true);
                }

                // FAQ
                if ((message.Contains("What") || message.Contains("what")) && (message.Contains(" rbo") || message.Contains(" RBO") || message.Contains(" rbo ") || message.Contains(" RBO ")))
                {
                    SendChatMessage("RBO stand for Reverse Boss Order. It requires beating the four statue bosses in the following order: Ridley, Draygon, Phantoon, Kraid.");
                }

                if (message.StartsWith("I think") || message.StartsWith("i think"))
                {
                    SendChatMessage("Nobody care what you think, " + user);
                }

                #endregion
            }

            // Logic for responding to an unknown event
            else
            {
                //Log.Message(chatEvent.ToString(), false);
            }
            #endregion
        }