public static async Task QuoteIntentProcessorAsync(SocketMessage message)
        {
            if (!message.Author.IsBot)
            {
                if (IsPotentialQuote(message))
                {
                    //check if the Guild has a QuoteChannel specified
                    if (Guild.GetGuildData(Quoter.Guild).QuoteChannelId != 0)
                    {
                        await SendQuoteConfirmationMessageAsync();

                        StartTimeoutTrigger();
                    }

                    else
                    {
                        //send a message if the service has failed
                        var easyEmbed = new EasyEmbed()
                        {
                            AuthorName       = "Failed to run the quote service",
                            EmbedColor       = Color.Red,
                            EmbedImage       = "https://cdn.discordapp.com/attachments/559700127275679762/595113538540797962/sadputin.png",
                            EmbedDescription = $"You must first specify a quote channel for this server, " +
                                               $"before you can use this command, for more information see the docs (tbd)",
                            FooterIcon = $"https://cdn.discordapp.com/attachments/559700127275679762/595110812314632205/585bad69cb11b227491c3284.png",
                            FooterText = $"This was an automated message, don't even at me comrade"
                        };

                        await Quote.Channel.SendMessageAsync(embed : easyEmbed.Build());

                        ResetVariables();
                    }
                }
            }
        }
Exemple #2
0
        public async Task Help([Remainder] string message)
        {
            ModuleInfo moduleInfo = default;

            //loop through the commands modules available
            //and check for which one has the same name as what the user typed
            //assign moduleInfo the command if there is a match
            foreach (ModuleInfo command in BotConfig.Commands.Modules)
            {
                if (message == command.Name)
                {
                    moduleInfo = command;
                }
            }

            //might be a pointless check
            if (message == moduleInfo.Name)
            {
                var field = new EmbedFieldBuilder {
                    Name = "Module Parameters", Value = moduleInfo.Remarks
                };

                //embed template
                var easyEmbed = new EasyEmbed()
                {
                    AuthorName = $"Module Name: {moduleInfo.Name}",
                    AuthorIcon = $"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/microsoft/209/thinking-face_1f914.png",
                    EmbedColor = Color.Purple,
                    EmbedField = field
                };

                //send the message
                await Context.Channel.SendMessageAsync(embed : easyEmbed.Build());
            }
        }
        /// <summary>
        /// Quote in question has been confirmed, transfer the quote to quotes channel
        /// </summary>
        /// <param name="reaction"></param>
        /// <returns></returns>
        public static async Task QuoteConfirmedAsync()
        {
            //stop the timer
            _timer.Stop();

            Guild    guildData   = Guild.GetGuildData(Quoter.Guild);
            DateTime currentTime = DateTime.Now;

            if (guildData.QuoteChannelId != 0)
            {
                var quoteChannel = await Quoter.Guild.GetTextChannelAsync(guildData.QuoteChannelId);

                var easyEmbed = new EasyEmbed
                {
                    EmbedColor       = Color.Green,
                    EmbedThumbnail   = $"{MentionedUsers.ElementAt(0).GetAvatarUrl()}",
                    EmbedDescription = $"{Quote.Content}",
                    FooterIcon       = Quoter.GetAvatarUrl(ImageFormat.Auto),
                    FooterText       = $"Quoted by: {Quoter} | {currentTime.ToString("dddd, dd MMMM yyyy h:mm:ss tt")}"
                };

                await quoteChannel.SendMessageAsync(embed : easyEmbed.Build());
            }

            //remove the confirmation message message
            await QuoteConfirmationMessage.DeleteAsync();

            // remove the original quote
            await Quote.DeleteAsync();

            ResetVariables();
        }
        public async Task GoodBot()
        {
            //get server sepcific GuildData
            Guild contextSpecificData = Guild.GetServerData(context: Context);

            //increment points
            contextSpecificData.Points++;

            //calculate the servers differnt score
            Guild.PointCalculations(contextSpecificData);

            //some embed field
            var field = new EmbedFieldBuilder
            {
                Name     = $"Slavenski was rescued from the freedom man",
                Value    = $"{contextSpecificData.Points} Slavenski(s) saved from the freedom man",
                IsInline = true
            };

            //embed template
            var easyEmbed = new EasyEmbed()
            {
                AuthorName = "Good Boy Blyat",
                AuthorIcon = $"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/microsoft/153/thumbs-up-sign_1f44d.png",
                EmbedColor = Color.Green,
                EmbedField = field,
                FooterText = $"You rescue a Slavenski, Blyatmir sees this and rewards you with a bottle of vodka" +
                             $"Slavensk now has a population of {contextSpecificData.Points}."
            };

            //send the message
            await Context.Channel.SendMessageAsync(embed : easyEmbed.Build());
        }
Exemple #5
0
        public async Task Help()
        {
            var fieldList = new List <EmbedFieldBuilder>();

            //foreach availble module
            //set the module description to "No Description" if there is no available description
            //create fields based on the module name and result of the above condition
            foreach (ModuleInfo module in BotConfig.Commands.Modules)
            {
                var result = (module.Summary == null) ? "No Description" : module.Summary;
                var field  = new EmbedFieldBuilder {
                    Name = module.Name, Value = result
                };
                fieldList.Add(field);
            }

            //embed template
            var easyEmbed = new EasyEmbed()
            {
                AuthorName       = "List of Commands",
                AuthorIcon       = $"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/microsoft/153/scroll_1f4dc.png",
                EmbedColor       = Color.Blue,
                EmbedDescription = $"If you'd like more information on how to use a command a certain command then use `/help [command name]` " +
                                   $"to get more detailed information.",
                EmbedFieldList = fieldList
            };

            //send the message
            await Context.Channel.SendMessageAsync(embed : easyEmbed.Build());
        }
Exemple #6
0
        public async Task BadBot()
        {
            //get server sepcific GuildData
            Guild contextSpecificData = Guild.GetServerData(context: Context);

            //decrement points
            contextSpecificData.Points--;

            //calculate new point statistics
            Guild.PointCalculations(contextSpecificData);

            //some embed field
            var field = new EmbedFieldBuilder
            {
                Name     = $"Slavenski was taken by the freedom man",
                Value    = $"{contextSpecificData.Points} Slavenski(s) lost to the freedom man",
                IsInline = true
            };

            //embed template
            var easyEmbed = new EasyEmbed()
            {
                AuthorName = "Bad Boy Blyat",
                AuthorIcon = $"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/microsoft/153/thumbs-down-sign_1f44e.png",
                EmbedColor = Color.Red,
                EmbedField = field,
                FooterText = $"You lose a Slavenski, Blyatmir looks disgusted and takes your bottle of vodka" +
                             $"Slavensk now has a population of {contextSpecificData.Points}."
            };

            //send the message
            await Context.Channel.SendMessageAsync(embed : easyEmbed.Build());
        }
Exemple #7
0
        public async Task PurgeChatAsync(int num)
        {
            //if true set count to 100
            //if false set count to the number specified + 1
            //+ 1 because we want to remove the message the user just sent to initiate this command
            //on top of the messages they originally wanted to delete
            var count = ((num > 100) ? 100 : num + 1);

            //just so it looks a bit smorter use the plural if num if more than one :)
            var endText = ((num > 1) ? "Messages." : "Message.");

            //gets the messages and deletes them
            var messages = await this.Context.Channel.GetMessagesAsync(count).FlattenAsync();

            await(Context.Channel as SocketTextChannel).DeleteMessagesAsync(messages);

            //message embed format
            var easyEmbed = new EasyEmbed()
            {
                AuthorName = $"Purged {count} {endText}",
                AuthorIcon = $"https://cdn.betterttv.net/emote/55028cd2135896936880fdd7/1x",
                EmbedColor = Color.Red
            };

            //send the message
            await Context.Channel.SendMessageAsync(embed : easyEmbed.Build());
        }
        /// <summary>
        /// Notify the Guild that the message has timed out
        /// </summary>
        /// <returns></returns>
        private static async Task <RestUserMessage> SendTimeoutMessageAsync()
        {
            var easyEmbed = new EasyEmbed
            {
                AuthorName       = $"You all left me to die, so i've let your quote rot away!",
                AuthorIcon       = $"{BotConfig.Client.CurrentUser.GetAvatarUrl()}",
                EmbedColor       = Color.Red,
                EmbedTitle       = "\nQuote Timed Out :(",
                EmbedDescription = $"A quote request has timed out for the following message\n\n \"*{ Quote.Content }*\" \n\n",
                FooterIcon       = $"https://cdn.discordapp.com/attachments/559700127275679762/595117013203025950/902023-1.png",
                FooterText       = $"This was an automated message, don't even at me comrade"
            };

            return(await Quote.Channel.SendMessageAsync(embed : easyEmbed.Build()));
        }
        public async Task PurgeChatAsync(int num)
        {
            var count = CalculateAmount(num);

            await DeleteMessages(num);

            //message embed format
            var easyEmbed = new EasyEmbed()
            {
                AuthorName = $"Purged {count} Message(s).",
                AuthorIcon = $"https://cdn.betterttv.net/emote/55028cd2135896936880fdd7/1x",
                EmbedColor = Color.Red
            };

            //send the message
            await Context.Channel.SendMessageAsync(embed : easyEmbed.Build());
        }
Exemple #10
0
        /// <summary>
        /// Tell somebody / something to fuckoff
        /// </summary>
        /// <param name="recipient">That somebody / something</param>
        /// <returns></returns>
        private async Task SendFuckOffMessage(string recipient)
        {
            //some more literal strings, should really move this soon
            string[] fuckoffASCII = new string[] { "凸ಠ益ಠ)凸",
                                                   "凸(`0´)凸",
                                                   "凸(>皿<)凸",
                                                   "┌∩┐(ಠ_ಠ)┌∩┐",
                                                   "凸(^▼ェ▼メ^)" };

            string[] fuckOffMessage = new string[] { $"You're not even worth the English {recipient}, vittu!",
                                                     $"{recipient}, Have you seen my f***s? I can't seem to find them",
                                                     $"F*****g f**k off,  {recipient}.",
                                                     $"{recipient}, shut the f**k up.",
                                                     $"Christ on a bendy-bus,  {recipient}, don't be such a f*****g faff-arse.",
                                                     $"What the f**k is you problem {recipient}?",
                                                     $"{recipient}, why don't you go outside and play hide-and-go-f**k-yourself?",
                                                     $"Christ on a bendy-bus,  {recipient}, don't be such a f*****g faff-arse.",
                                                     $"Remember when you f****d off  {recipient}? Those were the good times !",
                                                     $"{recipient}, back the f**k off.",
                                                     $"Who has two thumbs and doesn't give a f**k? {recipient}.",
                                                     $"{recipient}, what the f**k where you actually thinking?",
                                                     $"{recipient}, Thou clay-brained guts, thou knotty-pated fool, thou whoreson obscene greasy tallow-catch!",
                                                     $"{recipient}, do I look like I give a f**k?",
                                                     $"F**k you, {recipient}",
                                                     $"{recipient}, there aren't enough swear-words in the English language, so now I'll have to call you perkeleen " +
                                                     $"vittupää just to express my disgust and frustration with this crap.",
                                                     $"{recipient}, Here is a list I made of all the f***s I give: {Environment.NewLine}",
                                                     $"Merry F*****g Christmas, {recipient}.",
                                                     $"{recipient}: A f*****g problem solving super-hero." };

            var rnd = new Random();

            //embed template
            var easyEmbed = new EasyEmbed()
            {
                //use rnd as random indexing between the literal strings
                AuthorName = fuckoffASCII[rnd.Next(0, fuckoffASCII.Length)],
                AuthorIcon = $"https://cdn.discordapp.com/emojis/541203072869990400.png?v=1",
                EmbedColor = Color.LightOrange,
                FooterText = fuckOffMessage[rnd.Next(0, fuckOffMessage.Length)] + " - @" + Context.Message.Author.Username
            };

            //send the message
            await Context.Channel.SendMessageAsync(embed : easyEmbed.Build());
        }
Exemple #11
0
        public async Task DiceRollAsync(int num1, int num2)
        {
            //invalid number check
            if (num1 > num2)
            {
                //you get the point
                var failedEmbed = new EasyEmbed()
                {
                    AuthorName = "(╯°□°)╯︵ ┻━┻",
                    AuthorIcon = $"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/microsoft/153/game-die_1f3b2.png",
                    EmbedColor = Color.Red,
                    EmbedTitle = $"Dice Roll Failed",
                    FooterText = $"Your first number should be smaller than your second number"
                };

                //same thing as always
                await Context.Channel.SendMessageAsync("", false, failedEmbed.Build(), null);

                return;
            }

            //ya its the thing you've seen like 100 times already
            var field = new EmbedFieldBuilder
            {
                Name  = $"Roll",
                Value = $"`{new Random().Next(num1, num2)}`",
            };

            //wow templates, cool
            var successfulEmbed = new EasyEmbed()
            {
                AuthorName = "(╯°□°)╯︵ ┻━┻",
                AuthorIcon = $"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/microsoft/153/game-die_1f3b2.png",
                EmbedColor = Color.Green,
                EmbedTitle = $"Dice Roll Results",
                EmbedField = field,
                FooterText = $"Rolled on some mystical dice from bum f**k nowhere seems to have {num2 - num1 + 1} possible value(s)... BLYAT!"
            };

            //sending the damn message
            await Context.Channel.SendMessageAsync("", false, successfulEmbed.Build(), null);
        }
        public async Task Highscores()
        {
            string lessThanText = "";

            Guild guildData = Guild.GetServerData(context: Context);

            //sets the less than text to different values based on the point scenario
            if (guildData.Points == guildData.HighestPoints)
            {
                lessThanText = ($"There are no bad times in the motherland");
            }

            else if (guildData.Points < guildData.HighestPoints)
            {
                lessThanText = $"I said I had like {guildData.HighestPoints} stick(s) but then " +
                               $"they became our stick(s) and now I only have {guildData.LowestPoints} stick :(";
            }

            //list of embeds for the embed template
            var fieldList = new List <EmbedFieldBuilder>()
            {
                new EmbedFieldBuilder {
                    Name = "Stick Highs", Value = $"I had like so many sticks, at least {guildData.HighestPoints} of them"
                },
                new EmbedFieldBuilder {
                    Name = "Stick Lows", Value = $"{lessThanText}"
                }
            };

            //embed template
            var easyEmbed = new EasyEmbed()
            {
                AuthorName     = "Our good commie boy putin",
                AuthorIcon     = $"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/microsoft/153/thumbs-up-sign_1f44d.png",
                EmbedColor     = Color.Green,
                EmbedFieldList = fieldList
            };

            //send the message
            await Context.Channel.SendMessageAsync(embed : easyEmbed.Build());
        }
        public async Task ShowLeaderboard()
        {
            var fieldList = new List <EmbedFieldBuilder>();

            //get all guilds that wish to be listed, by default is true
            var listedGuilds = from Guild guilds in Guild.GuildDataList
                               where guilds.IsListed == true
                               select guilds;

            //order the listed guilds from largest to smallest in order to mimic a leaderboard
            var orderAndListedGuilds = from Guild guilds in listedGuilds
                                       orderby guilds.Points descending
                                       select guilds;

            //just some suffixes for our top 3 guilds
            string[] places = new string[] { "First", "Second", "Third" };

            //foreach listed guild add a field with their info
            for (int i = 0; i < listedGuilds.Count(); i++)
            {
                fieldList.Add(new EmbedFieldBuilder {
                    Name = $"**{places[i]} Place**", Value = $"{orderAndListedGuilds.ElementAt(i).GuildName} | `{orderAndListedGuilds.ElementAt(i).Points}`"
                });
            }

            //embed template
            var easyEmbed = new EasyEmbed()
            {
                AuthorName       = "Leaders of the USSR",
                AuthorIcon       = $"https://cdn.discordapp.com/attachments/559700127275679762/595131707490041886/1200px-Adidas_Logo.svg.png",
                EmbedColor       = Color.Gold,
                EmbedDescription = $"The current leaders of the USSR are as follows:",
                EmbedFieldList   = fieldList,
                FooterIcon       = $"https://cdn.discordapp.com/attachments/559700127275679762/595117013203025950/902023-1.png",
                FooterText       = $"This was an automated message, don't even at me comrade"
            };

            //send the message
            await Context.Channel.SendMessageAsync(embed : easyEmbed.Build());
        }
        public async Task DiceRollAsync(int maxValue)
        {
            //new field woo hoo
            EmbedFieldBuilder field = new EmbedFieldBuilder()
            {
                Name     = "Roll",
                Value    = $"`{this.RollDice(maxValue)}`",
                IsInline = false
            };

            //embed template
            var easyEmbed = new EasyEmbed()
            {
                AuthorName = "(╯°□°)╯︵ ┻━┻",
                AuthorIcon = $"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/microsoft/153/game-die_1f3b2.png",
                EmbedColor = Color.Green,
                EmbedTitle = $"Dice Roll Results",
                EmbedField = field,
                FooterText = $"Rolled on some mystical dice from bum f**k nowhere seems to have {maxValue} possible value(s)... BLYAT!"
            };

            //send the message
            await Context.Channel.SendMessageAsync(embed : easyEmbed.Build());
        }
        /// <summary>
        /// Sends a quote confirmation message
        /// </summary>
        /// <returns></returns>
        private static async Task SendQuoteConfirmationMessageAsync()
        {
            QuoteInQuestion = null;             //stops the bot from responding to previously sent messages and its own

            //embed template
            var easyEmbed = new EasyEmbed
            {
                AuthorName       = "Want me to quote this bish...",
                EmbedColor       = Color.Green,
                EmbedThumbnail   = $"https://cdn.discordapp.com/attachments/559700127275679762/594028718683455498/F****d-sm.png",
                EmbedDescription = $"I may be mostly blind, I may or may not have done one too many shooeys but this looks like a quote and just like karen did with the kids I can take them away.\n\n " +
                                   $"**Quote In Question**\n\n" +
                                   $"\"*{ Quote.Content }*\" \n\n" +
                                   $"`Click on one of the below reactions to continue...`",
                FooterIcon = $"https://cdn.discordapp.com/attachments/559700127275679762/595110812314632205/585bad69cb11b227491c3284.png",
                FooterText = $"This was an automated message and will expire in an hour if there is no response"
            };

            //send the message and keep a reference to it
            QuoteConfirmationMessage = await Quote.Channel.SendMessageAsync(embed : easyEmbed.Build());

            //add the reactions to the message
            await AddReactionsAsync();
        }