Ejemplo n.º 1
0
        public async Task PenguinFactAsync()
        {
            Random rand = new Random();

            //Get a fact from the file
            string penguinFact = "Did you know penguins have big bushy tails?";

            if (File.Exists(_dataServices.PenguinFactPath))
            {
                var allLines   = File.ReadAllLines(_dataServices.PenguinFactPath);
                var lineNumber = rand.Next(0, allLines.Length);
                penguinFact = allLines[lineNumber];
            }

            //Build and send
            var authBuilder = new EmbedAuthorBuilder()
            {
                Name    = $"PENGUIN FACTS!",
                IconUrl = Context.Message.Author.GetAvatarUrl(),
            };

            var footBuilder = new EmbedFooterBuilder()
            {
                Text = "This was penguin facts, you cannot unsubscribe."
            };
            var builder = new EmbedBuilder()
            {
                Author = authBuilder,
                Footer = footBuilder,

                ThumbnailUrl = this._dataServices.GetRandomImgFromUrl("https://content.tophattwaffle.com/BotHATTwaffle/penguinfacts/"),
                Color        = new Color(230, 235, 240),

                Description = penguinFact
            };
            await _dataServices.ChannelLog($"{Context.Message.Author.Username.ToUpper()} JUST GOT HIT WITH A PENGUIN FACT");

            await ReplyAsync("", false, builder.Build());
        }
Ejemplo n.º 2
0
        public async Task VMTEditorAsync()
        {
            var authBuilder = new EmbedAuthorBuilder()
            {
                Name    = "Download VMT Editor",
                IconUrl = "https://cdn.discordapp.com/icons/111951182947258368/0e82dec99052c22abfbe989ece074cf5.png",
            };

            var builder = new EmbedBuilder()
            {
                Author       = authBuilder,
                Title        = "Click Here",
                Url          = "https://gira-x.github.io/VMT-Editor/",
                ThumbnailUrl = "https://content.tophattwaffle.com/BotHATTwaffle/vmteditor.png",
                Color        = new Color(50, 50, 50),
                Description  = "VMT Editor is, hands down, one of the best VMT creation tools that exists for Source engine. " +
                               "It quickly became a standard tool for most designers that regularly create VMT files. " +
                               "Created by Yanzl over at MapCore."
            };

            await ReplyAsync("", false, builder.Build());
        }
Ejemplo n.º 3
0
        public async Task Join()
        {
            var user = Context.User as SocketGuildUser;

            if (user.VoiceChannel is null)
            {
                var builder = new EmbedBuilder()
                {
                    Color       = new Color(189, 16, 224),
                    Description = $"```You need to connect to a voice channel.```",
                    Title       = "Command"
                };
                builder.WithCurrentTimestamp();
                var Auther = new EmbedAuthorBuilder()
                             .WithName("Area51 Commander")
                             .WithIconUrl("https://i.imgur.com/xqfHEin.png");
                builder.WithAuthor(Auther);
                await ReplyAsync("", false, builder.Build());

                return;
            }
            else
            {
                var builder = new EmbedBuilder()
                {
                    Color       = new Color(189, 16, 224),
                    Description = $"```Now connected to {user.VoiceChannel.Name}```",
                    Title       = "Command"
                };
                builder.WithCurrentTimestamp();
                var Auther = new EmbedAuthorBuilder()
                             .WithName("Area51 Commander")
                             .WithIconUrl("https://i.imgur.com/xqfHEin.png");
                builder.WithAuthor(Auther);
                await _musicService.ConnectAsync(user.VoiceChannel, Context.Channel as ITextChannel);
                await ReplyAsync("", false, builder.Build());
            }
        }
Ejemplo n.º 4
0
        public async Task Waifus([Remainder] IUser user = null)
        {
            user ??= Context.User;

            var waifus = UserInventoryDb.GetWaifus(user.Id, Context.Guild.Id);

            if (waifus.Count <= 21)
            {
                await Context.Channel.SendMessageAsync("", false, UserUtil.WaifusEmbed((SocketGuildUser)user).Build());

                return;
            }

            var ordwaifus = waifus.OrderBy(x => x.Source).ThenBy(x => x.Name);
            var msg       = new CustomPaginatedMessage();

            var author = new EmbedAuthorBuilder()
            {
                IconUrl = user.GetAvatarUrl(),
                Name    = user.ToString()
            };

            msg.Author = author;

            msg.ThumbnailUrl = FeaturedWaifuDb.GetFeaturedWaifu(user.Id, Context.Guild.Id).HostImageUrl;
            var pages = CustomPaginatedMessage.PagesArray(ordwaifus, 15, (x) => String.Format("**{0}** - *{1}*\n", x.Name, x.Source.Length > 33 ? x.Source.Substring(0, 33) + "..." : x.Source), false);

            msg.Fields = new List <FieldPages> {
                new FieldPages {
                    Title = "Waifus :revolving_hearts:", Pages = pages
                }
            };
            msg.Pages = new List <string> {
                $"Open in [browser](https://namiko.moe/Guild/{Context.Guild.Id}/{user.Id})"
            };

            await PagedReplyAsync(msg);
        }
Ejemplo n.º 5
0
        public static async void SlapError(SocketMessage message)
        {
            var user    = message.Author;
            var channel = message.Channel;

            //Retrieve the account information of the command's user
            var account = UserInfoClasses.GetAccount(user);

            //Create an embeded message and declare the title
            var embed  = new EmbedBuilder();
            var author = new EmbedAuthorBuilder
            {
                Name    = "Social Command: Slap",
                IconUrl = user.GetAvatarUrl()
            };

            //Determine color for embeded message
            if (account.Profile_Theme == "P3")
            {
                embed.WithColor(37, 149, 255);
                embed.WithThumbnailUrl("https://i.imgur.com/CguM1ql.png");
            }
            else if (account.Profile_Theme == "P4")
            {
                embed.WithColor(255, 229, 49);
                embed.WithThumbnailUrl("https://i.imgur.com/PW7VtuB.png");
            }
            else if (account.Profile_Theme == "P5")
            {
                embed.WithColor(213, 27, 4);
                embed.WithThumbnailUrl("https://i.imgur.com/tubdL8K.png");
            }

            embed.WithAuthor(author);
            embed.WithDescription("Mention a user while using this command to slap them.");

            await channel.SendMessageAsync("", false, embed.Build());
        }
Ejemplo n.º 6
0
        public Embed DisplayServerReservations()
        {
            //Loop reservations and clear them if needed.
            var authBuilder = new EmbedAuthorBuilder()
            {
                Name = $"Current Server Reservations",
                //IconUrl = "https://www.tophattwaffle.com/wp-content/uploads/2017/11/1024_png-300x300.png",
            };

            List <EmbedFieldBuilder> fieldBuilder = new List <EmbedFieldBuilder>();

            foreach (UserData u in userData.ToList())
            {
                TimeSpan timeLeft = u.ServerReleaseTime.Subtract(DateTime.Now);
                fieldBuilder.Add(new EmbedFieldBuilder {
                    Name = $"{u.Server.Address}", Value = $"User: `{u.User}#{u.User.Discriminator}`\nTime Left: {timeLeft.ToString("h'H 'm'M'")}", IsInline = false
                });
            }

            string description = null;

            if (fieldBuilder.Count == 0)
            {
                description = "No reservations found";
            }

            var builder = new EmbedBuilder()
            {
                Fields       = fieldBuilder,
                Author       = authBuilder,
                Color        = new Color(243, 128, 72),
                ThumbnailUrl = "https://www.tophattwaffle.com/wp-content/uploads/2017/11/1024_png-300x300.png",

                Description = description
            };

            return(builder);
        }
Ejemplo n.º 7
0
        public async Task Uptime()
        {
            var auth = new EmbedAuthorBuilder()
            {
                Name = "Uptime",
            };

            var embed = new EmbedBuilder()
            {
                Color  = new Color(70, 140, 70),
                Author = auth,
            };

            using (var process = Process.GetCurrentProcess())
            {
                var time = DateTime.Now - process.StartTime;

                var sb = new StringBuilder();
                if (time.Days > 0)
                {
                    sb.Append($"{time.Days}d ");
                }
                if (time.Hours > 0)
                {
                    sb.Append($"{time.Hours}h ");
                }
                if (time.Minutes > 0)
                {
                    sb.Append($"{time.Minutes}m ");
                }
                sb.Append($"{time.Seconds}s ");

                embed.Title =
                    $"{sb}";

                await this.ReplyAsync("", false, embed.Build());
            }
        }
Ejemplo n.º 8
0
        public async Task BalanceAsync()
        {
            var    userInfo = (IGuildUser)Context.User;
            string userName = null;

            if (userInfo.Nickname != null)
            {
                userName = userInfo.Nickname;
            }
            else
            {
                userName = Context.User.Username;
            }

            var SQL      = new SQLFunctions.Main();
            var userData = SQL.LoadUserData(Context.User);

            var footer = new EmbedFooterBuilder
            {
                Text = "Cody by Ayla / Alsekwolf#0001"
            };
            var author = new EmbedAuthorBuilder
            {
                IconUrl = Context.User.GetAvatarUrl(),
                Name    = $"{userName}'s wallet"
            };
            var embed = new EmbedBuilder
            {
                Author      = author,
                Color       = Color.Magenta,
                Footer      = footer,
                Description = $"**{userName}** you currently have **${userData.cash}**",
                Timestamp   = DateTimeOffset.Now
            };

            var embedBuilt = embed.Build();
            await Context.Channel.SendMessageAsync(embed : embedBuilt);
        }
Ejemplo n.º 9
0
        public async Task StatsCommand()
        {
            if (Stats.IsReady)
            {
                using (Context.Channel.EnterTypingState())
                {
                    var appinfo = await Context.Client.GetApplicationInfoAsync();

                    var author = new EmbedAuthorBuilder()
                                 .WithIconUrl(new Uri(appinfo.IconUrl))
                                 .WithName(Context.Client.CurrentUser.Username);

                    var footer = new EmbedFooterBuilder()
                                 .WithText("Created by " + appinfo.Owner.Username);

                    var body = new EmbedBuilder()
                               .WithAuthor(author)
                               .WithFooter(footer)
                               .WithColor(Rand.GetRandomColor())
                               .WithTitle("Bot Statistics")
                               .WithDescription($"{Stats.UniqueUserCount} unique users\n" +
                                                $"{Stats.GuildCount} guilds\n" +
                                                $"{Stats.TextChannels} text channels\n" +
                                                $"{Stats.VoiceChannels} voice channels\n" +
                                                $"{Stats.RolesCount} roles");

                    body.AddInlineField("Largest Guild", $"{Stats.LargestGuild}\n{Stats.LargestGuildCount} users");
                    body.AddInlineField("Most Roles Guild", $"{Stats.MostRolesGuild}\n{Stats.MostRolesCount} roles");
                    body.AddInlineField($"Most Channels Guild", $"{Stats.MostChannelsGuild}\n{Stats.MostChannelsCount} channels");

                    await ReplyAsync("", embed : body);
                }
            }
            else
            {
                await ReplyAsync("Bot statistics has not been calculated yet.");
            }
        }
Ejemplo n.º 10
0
        public async Task Status([Remainder] SocketUser user = null)
        {
            user ??= Context.User;
            var account = EntityConverter.ConvertUser(user);
            var factory = new PlayerFighterFactory();
            var p       = factory.CreatePlayerFighter(account);

            var author = new EmbedAuthorBuilder();

            author.WithName($"{(user is SocketGuildUser sguser ? sguser.DisplayName() : user.Username)}");
            author.WithIconUrl(user.GetAvatarUrl());

            var embed = new EmbedBuilder()
                        .WithColor(Colors.Get(account.Element.ToString()))
                        .WithAuthor(author)
                        .WithTitle($"Level {account.LevelNumber} {account.GsClass} {string.Join("", account.TrophyCase.Trophies.Select(t => t.Icon))} (Rank {UserAccounts.GetRank(account) + 1})")
                        .AddField("Current Equip", account.Inv.GearToString(AdeptClassSeriesManager.GetClassSeries(account).Archtype), true)
                        .AddField("Psynergy", p.GetMoves(false), true)
                        .AddField("Djinn", account.DjinnPocket.GetDjinns().GetDisplay(DjinnDetail.None), true)

                        .AddField("Stats", p.Stats.ToString(), true)
                        .AddField("Elemental Stats", p.ElStats.ToString(), true)

                        .AddField("Unlocked Classes", account.BonusClasses.Count == 0 ? "none" : string.Join(", ", account.BonusClasses))

                        .AddField("XP", $"{account.Xp} - next in {account.XPneeded}{(account.NewGames >= 1 ? $"\n({account.TotalXp} total | {account.NewGames} resets)" : "")}", true)
                        .AddField("Colosso wins | Dungeon Wins", $"{account.ServerStats.ColossoWins} | {account.ServerStats.DungeonsCompleted}", true)
                        .AddField("Endless Streaks", $"Solo: {account.ServerStats.EndlessStreak.Solo} | Duo: {account.ServerStats.EndlessStreak.Duo} \nTrio: {account.ServerStats.EndlessStreak.Trio} | Quad: {account.ServerStats.EndlessStreak.Quad}", true);

            if (user is SocketGuildUser socketGuildUser)
            {
                var footer = new EmbedFooterBuilder();
                footer.WithText("Joined this Server on " + socketGuildUser.JoinedAt.Value.Date.ToString("dd-MM-yyyy"));
                footer.WithIconUrl(Sprites.GetImageFromName("Iodem"));
                embed.WithFooter(footer);
            }
            await Context.Channel.SendMessageAsync("", false, embed.Build());
        }
Ejemplo n.º 11
0
        static Embed generateTest()
        {
            EmbedBuilder em = new Discord.EmbedBuilder();

            em.Color = Discord.Color.Blue;
            em.Title = "Title";
            EmbedAuthorBuilder eab = new EmbedAuthorBuilder();

            eab.Url        = "http://www.google.com/";
            eab.Name       = "Embed Author Name";
            eab.IconUrl    = "https://i.imgur.com/2HXCkSR.png";
            em.Author      = eab;
            em.Description = "Description";
            EmbedFooterBuilder emfb = new EmbedFooterBuilder();

            emfb.IconUrl    = "https://i.imgur.com/Pieqv0h.png";
            emfb.Text       = "Footer text";
            em.Footer       = emfb;
            em.ImageUrl     = "https://i.imgur.com/Wks5VLA.png";
            em.ThumbnailUrl = "https://i.imgur.com/asc2NGx.png";
            em.Timestamp    = new DateTimeOffset(new DateTime(2042, 4, 20, 4, 20, 42));
            return(em.Build());
        }
Ejemplo n.º 12
0
        private async Task BootLoader(SocketMessage message)
        {
            var authBuilder = new EmbedAuthorBuilder()
            {
                Name    = $"Hey there {message.Author.Username}!",
                IconUrl = message.Author.GetAvatarUrl(),
            };

            var builder = new EmbedBuilder()
            {
                Author = authBuilder,

                Title        = $"Click here to go to the CR-10 Firmware flashing guide",
                Url          = "https://www.th3dstudio.com/knowledge-base/cr-10-bootloader-flashing-guide/",
                ThumbnailUrl = "https://www.th3dstudio.com/wp-content/uploads/2017/08/DiviLogo.fw_-3.png",
                Color        = new Color(243, 128, 72),

                Description = "Based on your previous message, I believe that you may be looking for information on flashing your bootloader. " +
                              "\n\nIf you have a Anet, you'll need to visit this link instead: https://www.th3dstudio.com/knowledge-base/anet-bootloader-flashing-video-guide/"
            };

            await message.Channel.SendMessageAsync("", false, builder);
        }
Ejemplo n.º 13
0
        public async Task GetTweet(ulong id)
        {
            Status tweet = TwitterService.GetTweet(id);

            var eb = new EmbedBuilder();
            EmbedAuthorBuilder tweetAuthor = new EmbedAuthorBuilder()
                                             .WithName(tweet.User.Name)
                                             .WithIconUrl(tweet.User.ProfileImageUrl);

            eb.WithAuthor(tweetAuthor);
            eb.WithColor(Color.Blue);
            eb.WithTimestamp(tweet.CreatedAt);
            eb.WithFooter(TwitterFooter);
            eb.WithDescription(tweet.FullText);

            if (tweet.ExtendedEntities.MediaEntities != null && tweet.ExtendedEntities.MediaEntities.Count > 0)
            {
                var mediaEntity = tweet.ExtendedEntities.MediaEntities[0];
                eb.WithImageUrl(mediaEntity.MediaUrl);
            }

            await Context.Channel.SendMessageAsync("", false, eb.Build());
        }
Ejemplo n.º 14
0
        public async Task Kick(IGuildUser user, [Remainder] string reason)
        {
            var builder = new EmbedBuilder()
            {
                Color       = new Color(189, 16, 224),
                Description = $"Username: { user.Mention } for {reason}",
                Title       = "User Kick Initiated"
            };

            builder.WithCurrentTimestamp();
            var Auther = new EmbedAuthorBuilder()
                         .WithName("Commander");

            builder.WithAuthor(Auther);
            builder.WithFooter($"Initiated by {user.Username}");

            ulong one = 696018470197788715;
            await Context.Guild.GetTextChannel(one).SendMessageAsync("", false, builder.Build());

            await user.Guild.AddBanAsync(user, reason : reason);

            await user.KickAsync();
        }
Ejemplo n.º 15
0
Archivo: osu.cs Proyecto: Kyuwu/Bott
        public async Task Erroruser()
        {
            var auth = new EmbedAuthorBuilder()
            {
                Name = $"Error",
            };
            var rnd     = new Random();
            int g1      = rnd.Next(1, 255);
            int g2      = rnd.Next(1, 255);
            int g3      = rnd.Next(1, 255);
            var builder = new EmbedBuilder()
            {
                Color  = new Discord.Color(g1, g2, g3),
                Author = auth,
            };

            builder.Description  = $"User not found.";
            builder.ThumbnailUrl =
                $"https://raw.githubusercontent.com/ThijmenHogenkamp/Bot/master/Luxary/bin/Debug/pic/oh.png";
            await ReplyAsync("", false, builder.Build());

            return;
        }
Ejemplo n.º 16
0
        private async Task Firmware(SocketMessage message)
        {
            var authBuilder = new EmbedAuthorBuilder()
            {
                Name    = $"Hey there {message.Author.Username}!",
                IconUrl = message.Author.GetAvatarUrl(),
            };

            var builder = new EmbedBuilder()
            {
                Author = authBuilder,

                Title        = $"Click here to go to the firmware page!",
                Url          = "https://www.th3dstudio.com/knowledge-base/th3d-unified-firmware/",
                ThumbnailUrl = "https://www.th3dstudio.com/wp-content/uploads/2017/08/DiviLogo.fw_-3.png",
                Color        = new Color(243, 128, 72),

                Description = "Based on your previous message, I believe that you may be looking for information on TH3D Unified Firmware. " +
                              "This page is full of helpful information, along with downloads."
            };

            await message.Channel.SendMessageAsync("", false, builder);
        }
Ejemplo n.º 17
0
        public static EmbedAuthorBuilder SetAuthor(String icon = null, String name = null, String url = null)
        {
            var iconExists            = !String.IsNullOrWhiteSpace(icon);
            var nameExists            = !String.IsNullOrWhiteSpace(name);
            var urlExists             = !String.IsNullOrWhiteSpace(url);
            EmbedAuthorBuilder author = new EmbedAuthorBuilder();

            if (iconExists)
            {
                try { author.WithIconUrl(icon); } catch (Exception) { }
            }
            ;
            if (nameExists)
            {
                author.WithName(name);
            }
            if (urlExists)
            {
                try { author.WithUrl(url); } catch (Exception) { }
            }
            ;
            return(author);
        }
Ejemplo n.º 18
0
        private static Embed createEmbed(SyndicationItem feedItem, SyndicationFeed parent)
        {
            EmbedBuilder e = new EmbedBuilder();

            e.Color = new Color(255, 255, 255);
            e.Title = feedItem.Title?.Text;
            e.Url   = feedItem.Links?.FirstOrDefault(x => !isImageUrl(x.Uri?.AbsoluteUri ?? ""))?.Uri?.AbsoluteUri ?? feedItem.BaseUri?.AbsoluteUri;

            try{
                e.Timestamp = feedItem.PublishDate.UtcDateTime.Year > 1 ? feedItem.PublishDate.UtcDateTime : feedItem.LastUpdatedTime.UtcDateTime;
            } catch (Exception ex) {
                e.Timestamp = DateTime.UtcNow;
            }

            EmbedFooterBuilder footer = new EmbedFooterBuilder();

            footer.IconUrl = "https://cdn5.vectorstock.com/i/1000x1000/82/39/the-news-icon-newspaper-symbol-flat-vector-5518239.jpg";
            footer.Text    = "RSS feed";
            e.Footer       = footer;

            EmbedAuthorBuilder author = new EmbedAuthorBuilder();

            author.Name = (feedItem.Authors?.FirstOrDefault()?.Name ?? feedItem.Authors?.FirstOrDefault()?.Email) ?? parent.Title?.Text;
            author.Url  = feedItem.Authors?.FirstOrDefault()?.Uri;
            e.Author    = author;

            e.ThumbnailUrl = parent.ImageUrl?.AbsoluteUri;

            e.Description = (new string(HtmlToPlainText(feedItem.Summary?.Text ?? "", out string htmlImage).Take(Math.Min(2000, feedItem.Summary?.Text?.Length ?? 0)).ToArray()));
            e.ImageUrl    = !string.IsNullOrEmpty(htmlImage) ? htmlImage : feedItem.Links?.FirstOrDefault(x => isImageUrl(x.Uri?.AbsoluteUri ?? ""))?.Uri?.AbsoluteUri;
            if (e.Description.Length >= 2000)
            {
                e.Description += " [...]";
            }

            return(e.Build());
        }
Ejemplo n.º 19
0
        public async Task Info(Discord.IUser user)
        {
            Discord.IUser U             = user;
            Discord.IUser E             = Context.Message.Author;
            string        imgurl        = U.AvatarId;
            string        userurl       = U.Id.ToString();
            string        AvatartoEmbed = $"https://cdn.discordapp.com/avatars/{userurl}/{imgurl}.webp?size=1024";
            Random        rnd           = new Random();
            int           red           = rnd.Next(0, 255);
            int           green         = rnd.Next(0, 255);
            int           blue          = rnd.Next(0, 255);
            var           EmbedAuth     = new EmbedAuthorBuilder
            {
                Name = U.ToString(),
            };

            var EmbedFoot = new EmbedFooterBuilder
            {
                IconUrl = "https://cdn.discordapp.com/embed/avatars/0.png",
                Text    = $"Generated - {DateTime.UtcNow.ToLongDateString()}",
            };

            var EmbedBuilder = new EmbedBuilder
            {
                Title    = "Profile Picture",
                Author   = EmbedAuth,
                ImageUrl = AvatartoEmbed,
                Footer   = EmbedFoot,
                Url      = AvatartoEmbed,
                Color    = new Discord.Color(red, green, blue),
            }.Build();

            await Discord.UserExtensions.SendMessageAsync(E, embed : EmbedBuilder);


            await Context.Message.DeleteAsync();
        }
Ejemplo n.º 20
0
        internal static async void AllRanksMaxedMessage(SocketMessage message)
        {
            var user    = message.Author;
            var channel = message.Channel;

            var account = UserInfoClasses.GetAccount(user);

            var embed  = new EmbedBuilder();
            var author = new EmbedAuthorBuilder
            {
                Name    = "ALL RANKS MAXED!!",
                IconUrl = user.GetAvatarUrl()
            };

            //Determine color for embeded message
            if (account.Profile_Theme == "P3")
            {
                embed.WithColor(37, 149, 255);
                embed.WithThumbnailUrl("https://i.imgur.com/CguM1ql.png");
            }
            else if (account.Profile_Theme == "P4")
            {
                embed.WithColor(255, 229, 49);
                embed.WithThumbnailUrl("https://i.imgur.com/PW7VtuB.png");
            }
            else if (account.Profile_Theme == "P5")
            {
                embed.WithColor(213, 27, 4);
                embed.WithThumbnailUrl("https://i.imgur.com/tubdL8K.png");
            }

            embed.WithAuthor(author);

            embed.WithDescription("You've maxed out all social stats!");

            await channel.SendMessageAsync("", false, embed.Build());
        }
Ejemplo n.º 21
0
        public static async Task P2IS_PS1_Set_List(SocialLinkerCommand sl_command)
        {
            // Create two variables for the command user and the command channel, derived from the message object taken in.
            SocketUser        user    = sl_command.User;
            SocketTextChannel channel = (SocketTextChannel)sl_command.Channel;

            // Get the account information of the command's user.
            var account = UserInfoClasses.GetAccount(user);

            var embed  = new EmbedBuilder();
            var author = new EmbedAuthorBuilder
            {
                Name    = "Persona 2: Innocent Sin (PlayStation®️) Conversation Portrait Sets",
                IconUrl = user.GetAvatarUrl()
            };

            embed.WithAuthor(author);

            // Set the color and thumbnail for the embeded message.
            embed.WithColor(EmbedSettings.Get_Game_Color("P2IS-PS1", null));
            embed.WithThumbnailUrl(EmbedSettings.Get_Game_Logo("P2IS-PS1"));

            // Create a description with the list of sprite sets available for the title.
            embed.WithDescription($"{OfficialSetMethods.Generate_Normal_Set_List("P2IS-PS1")}");

            // Create a footer based on the game version the list is from.
            var footer = new EmbedFooterBuilder
            {
                Text = "Version: P2IS-PS1"
            };

            // Add the footer to the embed.
            embed.WithFooter(footer);

            // Send the embeded message to the channel.
            await channel.SendMessageAsync("", false, embed.Build());
        }
Ejemplo n.º 22
0
        public static async Task ReportAsync(Color color, SocketTextChannel channel, string title, string content, SocketUser originUser, SocketUser targetUser = null, string footerText = null)
        {
            EmbedBuilder eb = new EmbedBuilder();

            EmbedAuthorBuilder authorBuilder = new EmbedAuthorBuilder();

            authorBuilder.WithName(title);
            //authorBuilder.WithUrl("Title URL");
            authorBuilder.WithIconUrl(originUser.GetAvatarUrl());

            eb.WithAuthor(authorBuilder);
            eb.WithColor(color);
            eb.WithDescription(content);

            eb.WithCurrentTimestamp();

            if (footerText != null)
            {
                EmbedFooterBuilder footer = new EmbedFooterBuilder();
                //footer.WithIconUrl("URL to footer image");
                footer.WithText(footerText);
                eb.WithFooter(footer);
            }

            //eb.WithTitle("Title");
            if (targetUser != null)
            {
                eb.WithThumbnailUrl(targetUser.GetAvatarUrl());
            }
            else
            {
                eb.WithThumbnailUrl(originUser.GetAvatarUrl());
            }
            //eb.WithUrl("http://EBUrlshow.com");

            await reportChannel.SendMessageAsync("", false, eb.Build());
        }
Ejemplo n.º 23
0
        public async Task Help()
        {
            //string avatarLocation = @"C:\Users\Amagi\source\repos\EimiBot\EimiBot2\images\bot\ava.jpg";
            log.Info("Help booted up");
            string       avatarUrl = "https://i.imgur.com/uhvitiQ.jpg";
            EmbedBuilder eb        = new EmbedBuilder();

            string title = "Eimi Bot v0.01";

            var ab = new EmbedAuthorBuilder()
                     .WithName(title)
                     .WithIconUrl(avatarUrl);

            var fb = new EmbedFooterBuilder()
                     .WithText("Powered by the programmer");

            var link = new EmbedFieldBuilder()
                       .WithName("Message Link Repeater")
                       .WithValue("・link");

            var fun = new EmbedFieldBuilder()
                      .WithName("Fun")
                      .WithValue("・bento / bentou\n・ping");

            var admin = new EmbedFieldBuilder()
                        .WithName("Admin")
                        .WithValue("・prefix\n・delete");

            eb.AddField(link);
            eb.AddField(fun);
            eb.AddField(admin);
            eb.WithTitle("List of Commands: (!e)");
            eb.WithAuthor(ab);
            eb.WithFooter(fb);

            await Context.Channel.SendMessageAsync("", false, eb.Build());
        }
Ejemplo n.º 24
0
        public async Task Leave()
        {
            var user = Context.User as SocketGuildUser;

            if (user.VoiceChannel is null)
            {
                var builder = new EmbedBuilder()
                {
                    Color       = new Color(189, 16, 224),
                    Description = $"```Please join the channel the bot is in to make it leave.```",
                    Title       = "Command"
                };
                builder.WithCurrentTimestamp();
                var Auther = new EmbedAuthorBuilder()
                             .WithName("Commander");
                builder.WithAuthor(Auther);
                await ReplyAsync("", false, builder.Build());

                return;
            }
            else
            {
                await _musicService.LeaveAsync(user.VoiceChannel);

                var builder = new EmbedBuilder()
                {
                    Color       = new Color(189, 16, 224),
                    Description = $"```Bot has now left {user.VoiceChannel.Name}```",
                    Title       = "Command"
                };
                builder.WithCurrentTimestamp();
                var Auther = new EmbedAuthorBuilder()
                             .WithName("Commander");
                builder.WithAuthor(Auther);
                await ReplyAsync("", false, builder.Build());
            }
        }
Ejemplo n.º 25
0
        public static async void SlapBot(SocketMessage message)
        {
            var user    = message.Author;
            var channel = message.Channel;

            var account = UserInfoClasses.GetAccount(user);

            var embed  = new EmbedBuilder();
            var author = new EmbedAuthorBuilder
            {
                Name    = "Ow!",
                IconUrl = user.GetAvatarUrl()
            };

            //Determine color for embeded message
            if (account.Profile_Theme == "P3")
            {
                embed.WithColor(37, 149, 255);
            }
            else if (account.Profile_Theme == "P4")
            {
                embed.WithColor(255, 229, 49);
            }
            else if (account.Profile_Theme == "P5")
            {
                embed.WithColor(213, 27, 4);
            }

            embed.WithAuthor(author);
            embed.WithDescription("Social Linker needs a minute to recover...");

            await channel.SendMessageAsync("", false, embed.Build());

            //If the user slaps Social Linker, their messages will be ignored for 1 minute
            Core.LevelSystem.TimeOut.SetTimeOut(user, 1);
        }
Ejemplo n.º 26
0
        public virtual EmbedBuilder GetEmbedBuilder()
        {
            var author = new EmbedAuthorBuilder()
                         .WithIconUrl(GetIconUrl())
                         .WithName(Name)
                         .WithUrl(Url);

            var footer = new EmbedFooterBuilder()
                         .WithIconUrl(FooterIconUrl)
                         .WithText("Yu-Gi-Oh!");

            var body = new EmbedBuilder()
                       .WithColor(GetColor())
                       .WithAuthor(author)
                       .WithFooter(footer)
                       .WithDescription(GetDescription().Join("\n"));

            if (!string.IsNullOrWhiteSpace(Img))
            {
                body.ImageUrl = Img;
            }

            return(AddAdditionalFields(AddLore(body)));
        }
Ejemplo n.º 27
0
        /// <summary>
        /// Shames users for asking about carve.
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        private async Task Carve(SocketMessage message)
        {
            var authBuilder = new EmbedAuthorBuilder()
            {
                Name    = $"Hey there {message.Author.Username}!",
                IconUrl = message.Author.GetAvatarUrl(),
            };

            var builder = new EmbedBuilder()
            {
                Author = authBuilder,

                Title = $"DO NOT USE CARVE",
                //ThumbnailUrl = "https://www.tophattwaffle.com/wp-content/uploads/2017/11/1024_png-300x300.png",
                Color = new Color(243, 128, 72),

                Description = $"You were asking about carve. We don't use carve here. Not only does it create bad brushwork, but it " +
                              $"can also cause Hammer to stop responding and crash. If you're here trying to defend using carve, just stop - you are wrong."
            };

            await message.Channel.SendMessageAsync("", false, builder);

            await DataBaseUtil.AddShitpostAsync("Carve", message);
        }
Ejemplo n.º 28
0
		/// <summary>
		/// Big AND true.
		/// </summary>
		/// <param name="message"></param>
		/// <returns></returns>
		private Task Tanooki(SocketMessage message)
		{
			_dataServices.ChannelLog($"{message.Author} posted about Tanooki #{message.Channel}. You should go meme them.");
			var authBuilder = new EmbedAuthorBuilder()
			{
				Name = $"Hey there {message.Author.Username}!",
				IconUrl = message.Author.GetAvatarUrl(),
			};

			var builder = new EmbedBuilder()
			{
				Author = authBuilder,
				Title = $"You talking about the worst csgo player ever?",

				ThumbnailUrl = _dataServices.GetRandomImgFromUrl("https://content.tophattwaffle.com/BotHATTwaffle/tanookifacts/"),
				Color = new Color(243, 128, 72),

				Description = $"I see that we both share the same love for terrible admins."
			};

			message.Channel.SendMessageAsync("", false, builder);

			return Task.CompletedTask;
		}
Ejemplo n.º 29
0
		/// <summary>
		/// de_york really is the best level
		/// </summary>
		/// <param name="message"></param>
		/// <returns></returns>
		private Task DeYork(SocketMessage message)
		{
			_dataServices.ChannelLog($"{message.Author} posted about de_york #{message.Channel}. You should go meme them.");
			var authBuilder = new EmbedAuthorBuilder()
			{
				Name = $"Hey there {message.Author.Username}!",
				IconUrl = message.Author.GetAvatarUrl(),
			};

			var builder = new EmbedBuilder()
			{
				Author = authBuilder,
				Title = $"You talking about the best level ever?",

				ImageUrl = _dataServices.GetRandomImgFromUrl("https://content.tophattwaffle.com/BotHATTwaffle/york/"),
				Color = new Color(243, 128, 72),

				Description = $"I see that we both share the same love for amazing levels."
			};

			message.Channel.SendMessageAsync("", false, builder);

			return Task.CompletedTask;
		}
Ejemplo n.º 30
0
        public static async Task ModLog(SocketCommandContext context, string action, Color color, string reason, IUser subject = null, string extra = "")
        {
            var guild = await GuildRepository.FetchGuildAsync(context.Guild.Id);

            EmbedFooterBuilder footer = new EmbedFooterBuilder()
            {
                IconUrl = "http://i.imgur.com/BQZJAqT.png",
                Text    = $"Case #{guild.CaseNumber}"
            };
            EmbedAuthorBuilder author = new EmbedAuthorBuilder()
            {
                IconUrl = context.User.GetAvatarUrl(),
                Name    = $"{context.User.Username}#{context.User.Discriminator}"
            };

            string userText = null;

            if (subject != null)
            {
                userText = $"\n** User:** { subject} ({ subject.Id})";
            }
            var builder = new EmbedBuilder()
            {
                Author      = author,
                Color       = color,
                Description = $"**Action:** {action}{extra}{userText}\n**Reason:** {reason}",
                Footer      = footer
            }.WithCurrentTimestamp();

            if (context.Guild.GetTextChannel((ulong)guild.ModLogId) != null)
            {
                await context.Guild.GetTextChannel((ulong)guild.ModLogId).SendMessageAsync("", embed: builder);

                await GuildRepository.ModifyAsync(x => { x.CaseNumber++; return(Task.CompletedTask); }, context.Guild.Id);
            }
        }