/// <summary>
        /// useful admin tools
        /// </summary>
        /// <param name="e"></param>
        /// <returns></returns>
        private bool AdminTree(MessageEventArgs e)
        {
            string[] Args = ArgMaker(e.Message.Text.Remove(0, 2));

            if (Args.Count() < 1)
            {
                return(false);
            }

            if (Args[0].ToLower() == "help")
            {
                e.Channel.SendMessage("Thanks for asking!:kissing_heart:\nFor Admin Commands.:cocktail:\n!#inviteme -> Generates a link to invite her to your server\n!#clean -> Cleans messages (tell it how many)\n!#broadcast -> Broadcast to all channels.\n!#bbroadcast -> Bold broadcast to all channels.\n!#onlinesayhi -> Should Say Hi when on you come online (off / on)");
            }
            else if (Args[0].ToLower() == "inviteme")
            {
                e.Channel.SendMessage(":wave: Hello there! :wave: \nI am Kaname Chidori:kissing_heart:\nUse this link to invite me to your server:love_letter:\n" + @"https://discordapp.com/oauth2/authorize?&client_id=192361072039165953&scope=bot&permissions=194552229183750144");
            }
            else if (Args[0].ToLower() == "broadcast")
            {
                if (e.User.ServerPermissions.Administrator)
                {
                    string message = "";
                    for (int i = 1; i < Args.Length; i++)
                    {
                        message += Args[i] + " ";
                    }
                    foreach (Channel c in e.Server.TextChannels)
                    {
                        c.SendMessage(message);
                    }
                }
                else
                {
                    e.Channel.SendMessage("I am sorry but you do not have the clearance for this!:lock::gun:");
                    e.Channel.SendFile(PathGetter.GetImagePath("images3.jpg"));
                }
            }
            else if (Args[0].ToLower() == "bbroadcast")
            {
                if (e.User.ServerPermissions.Administrator)
                {
                    string message = "";
                    for (int i = 1; i < Args.Length; i++)
                    {
                        message += Args[i] + " ";
                    }
                    foreach (Channel c in e.Server.TextChannels)
                    {
                        c.SendMessage("**" + message + "**");
                    }
                }
                else
                {
                    e.Channel.SendMessage("I am sorry but you do not have the clearance for this!:lock::gun:");
                    e.Channel.SendFile(PathGetter.GetImagePath("images3.jpg"));
                }
            }
            else if (Args.Count() == 2 && Args[0].ToLower() == "clean")
            {
                if (e.User.ServerPermissions.Administrator)
                {
                    Thread.Sleep(20);
                    int num;
                    if (int.TryParse(Args[1], out num))
                    {
                        Task <Message[]> test = e.Channel.DownloadMessages(num);
                        test.Wait();
                        if (test.IsCompleted)
                        {
                            Message[] ToDel = test.Result;
                            for (int i = 1; i < ToDel.Length; i++)
                            {
                                ToDel[i].Delete();
                            }
                        }
                    }
                    else
                    {
                        e.Channel.SendMessage("Tell me how many to remove and it will be done.");
                    }
                }
                else
                {
                    e.Channel.SendMessage("I am sorry but you do not have the clearance for this!:lock::gun:");
                    e.Channel.SendFile(PathGetter.GetImagePath("images3.jpg"));
                }
            }
            else if (Args.Count() == 2 && Args[0].ToLower() == "onlinesayhi")
            {
                if (e.User.ServerPermissions.Administrator)
                {
                    if (Args[1].ToLower() == "off")
                    {
                        OnlineSayHi = false;
                    }
                    else if (Args[1].ToLower() == "on")
                    {
                        OnlineSayHi = true;
                    }
                }
                else
                {
                    e.Channel.SendMessage("I am sorry but you do not have the clearance for this!:lock::gun:");
                    e.Channel.SendFile(PathGetter.GetImagePath("images3.jpg"));
                }
            }
            else if (Args[0].ToLower() == "onlinesayhi")
            {
                e.Channel.SendMessage("Please tell me a state to go into after command (on / off)");
            }
            else
            {
                return(false);
            }
            return(true);
        }
예제 #2
0
        /// <summary>
        /// chat tree
        /// </summary>
        /// <param name="e"></param>
        /// <returns></returns>
        private bool ChatTree(MessageEventArgs e)
        {
            string[] Args = ArgMaker(e.Message.Text.Remove(0, 2));

            if (Args.Count() < 1)
            {
                return(false);
            }

            if (Args[0] == "help")
            {
                e.Channel.SendMessage("Thanks for asking!:kissing_heart:\nFor chat Commands.:love_letter:\n!~slap -> slap a person(s)\n!~smite -> smite a person(s)\n!~meme list -> Gets key list\n!~meme [key] [Top words] [Bottom words]-> makes a meme");
            }
            else if (Args[0].ToLower() == "meme")
            {
                if (Args.Count() == 2 && Args[1].ToLower() == "list")
                {
                    string list = "";
                    foreach (KeyValuePair <string, string> p in Memes)
                    {
                        list += "\n-" + p.Key;
                    }
                    e.Channel.SendMessage("Thanks for asking!:kissing_heart:\nThere are " + Memes.Keys.Count + list + "\ntry\n!~meme [key] [Top words] [Bottom words]");
                }
                else if (Args.Count() == 4 && Memes.ContainsKey(Args[1].ToLower()))
                {
                    SendMeme(e, Args);
                }
                else
                {
                    string list = "";
                    foreach (KeyValuePair <string, string> p in Memes)
                    {
                        list += "\n-" + p.Key;
                    }
                    e.Channel.SendMessage("Let me help you with a list!:kissing_heart:\nThere are " + Memes.Keys.Count + list + "\ntry\n!~meme [key] [Top words] [Bottom words]");
                }
            }
            else if (Args.Count() > 1 && Args[0].ToLower() == "slap")
            {
                if (e.Message.MentionedUsers.Count() > 1)
                {
                    string users = "";
                    foreach (User u in e.Message.MentionedUsers)
                    {
                        users += " " + u.Mention;
                    }
                    e.Channel.SendMessage(e.User.Mention + " circle slaps" + users + "!");
                }
                else if (e.Message.MentionedUsers.Count() > 0 && e.Message.MentionedUsers?.First()?.Name == e.User.Name)
                {
                    e.Channel.SendMessage(e.User.Mention + " slaps him self.");
                }
                else if (e.Message.MentionedUsers.Count() > 0)
                {
                    e.Channel.SendMessage(e.User.Mention + " slaps " + e.Message.MentionedUsers.First().Mention + "!");
                }
                else
                {
                    e.Channel.SendMessage(e.User.Mention + " slaps but misses!");
                }
            }
            else if (Args[0].ToLower() == "smite")
            {
                if (e.Message.MentionedUsers.Count() > 1)
                {
                    string users = "";
                    foreach (User u in e.Message.MentionedUsers)
                    {
                        users += " " + u.Mention;
                    }
                    e.Channel.SendFile(PathGetter.GetImagePath("Smite.jpg"));
                    Thread.Sleep(20);
                    e.Channel.SendMessage(e.User.Mention + " multi smites " + users + " with the power of a thousand paper fans!");
                }
                else if (e.Message.MentionedUsers.Count() > 0 && e.Message.MentionedUsers?.First()?.Name == e.User.Name)
                {
                    e.Channel.SendFile(PathGetter.GetImagePath("Smite.jpg"));
                    Thread.Sleep(20);
                    e.Channel.SendMessage(e.User.Mention + " Smites him self with the power of a thousand paper fans!");
                }
                else if (e.Message.MentionedUsers.Count() > 0)
                {
                    e.Channel.SendFile(PathGetter.GetImagePath("Smite.jpg"));
                    Thread.Sleep(20);
                    e.Channel.SendMessage(e.User.Mention + " Smites " + e.Message.MentionedUsers.First().Mention + " with the power of a thousand paper fans!");
                }
                else
                {
                    e.Channel.SendFile(PathGetter.GetImagePath("Smite.jpg"));
                    Thread.Sleep(20);
                    e.Channel.SendMessage(e.User.Mention + " Smites with a paper fan, but misses!");
                }
            }
            //else if (Args[0].ToLower() == "chat")
            //{
            //    //TopTalk(e);
            //}
            else
            {
                return(false);
            }
            return(true);
        }