Exemple #1
0
        public async Task Flip([Remainder] string input)
        {
            await ModuleUtilities.DeleteMessage(Context);

            string flippedString = "";

            foreach (char letter in input)
            {
                if (Char.IsLetter(letter))
                {
                    if (Char.IsUpper(letter))
                    {
                        flippedString = Regex.Unescape(SpeakModObjects.flipDicCaps[letter.ToString()]).Normalize() + flippedString;
                    }
                    else
                    {
                        flippedString = Regex.Unescape(SpeakModObjects.flipDicLower[letter.ToString()]).Normalize() + flippedString;
                    }
                }
                else
                {
                    flippedString = letter + flippedString;
                }
            }

            await ReplyAsync(flippedString);
        }
Exemple #2
0
        public async Task Muddle([Remainder] string input)
        {
            await ModuleUtilities.DeleteMessage(Context);

            List <string> words = input.Split(' ').ToList();

            string muddledSentance = "";

            //golf it because
            //having it in the select like that, must do some sort of caching, same result for same input in string every time, desirable?
            muddledSentance += String.Join(String.Empty, words.Select(w => { return(Scramble(w) + " "); }));
            await ReplyAsync(muddledSentance);
        }
Exemple #3
0
        public async Task MockBob([Remainder] string input)
        {
            await ModuleUtilities.DeleteMessage(Context);

            string oldMsg = input;

            string newMsg = "";

            newMsg += Context.User.Username.ToString() + ": ";

            for (int i = 0; i < oldMsg.Length; i++)
            {
                newMsg += (i % 2 == 0 ? Char.ToUpper(oldMsg[i]) : Char.ToLower(oldMsg[i]));
            }
            await ReplyAsync(newMsg + "\n\r" + "http://i.imgflip.com/1rn9v3.jpg");
        }
Exemple #4
0
        public async Task MemSpeak([Remainder] string input)
        {
            await ModuleUtilities.DeleteMessage(Context);

            string oldMsg = input;
            string newMsg = "";

            newMsg += Context.User.Username.ToString() + ": ";

            for (int i = 0; i < oldMsg.Length; i++)
            {
                newMsg += oldMsg[i] + (i < oldMsg.Length - 1 ? "(" : "");
            }
            newMsg += new string(')', oldMsg.Length - 1);
            await ReplyAsync(newMsg);
        }
Exemple #5
0
        public async Task Scrust(int maxChars, [Remainder] string input)
        {
            await ModuleUtilities.DeleteMessage(Context);

            string oldMsg = input;

            string newMsg = "";

            newMsg += Context.User.Username.ToString() + ": ";

            string[] diacriticalPrefixes = { @"\u030", @"\u031", @"\u032", @"\u033", @"\u034", @"\u035", @"\u036" };

            Random random        = new Random();
            var    scrustyString = "";

            foreach (char c in input)
            {
                if (c == ' ')
                {
                    scrustyString += " ";
                    continue;
                }
                string modChar  = c.ToString();
                int    toAdd    = random.Next(0, maxChars);
                var    diaCrits = "";
                for (int i = 0; i < toAdd; i++)
                {
                    var firstPart  = diacriticalPrefixes[random.Next(0, 7)];
                    var secondPart = random.Next(0, 16).ToString("X");
                    diaCrits = Regex.Unescape((diaCrits + (firstPart + secondPart))).Normalize();
                    ;
                }
                modChar        = Regex.Unescape((modChar + diaCrits)).Normalize();
                scrustyString += modChar;
            }
            await ReplyAsync(scrustyString);
        }