public static EmbedBuilder InfoEmbed() { var eb = new EmbedBuilder(); var client = Program.GetClient(); string desc = "Discord bot made in C#, featuring innovations like waifu shops, a banroulette, teams and extensive currency and economy features."; eb.WithDescription(desc); string field = "Creator: taiHen#2839\n"; field += $"Support Server: [Namiko Test Realm]({LinkHelper.SupportServerInvite})\n"; field += $"Usage Guide: [Guide]({LinkHelper.Guide})\n"; field += $"Origin Server: [AMFWT]({LinkHelper.AmfwtServerInvite})\n"; field += $"Invite Link: [Namiko]({LinkHelper.GetRedirectUrl(LinkHelper.BotInvite, "BotInvite", "cmd-info")})\n"; field += $"Repository: [Github]({LinkHelper.Repository})\n"; field += $"Get Pro: [Patreon]({LinkHelper.GetRedirectUrl(LinkHelper.Patreon, "Patreon", "cmd-info")}) :star:"; eb.AddField("References", field); eb.WithAuthor(client.CurrentUser); eb.WithColor(BasicUtil.RandomColor()); eb.WithFooter("-What are you? Twelve?"); eb.WithImageUrl(AppSettings.NamikoBannerUrl); return(eb); }
// Shop Message generators /*public static EmbedBuilder GetShopEmbed(List<ShopWaifu> waifus, string prefix) { var client = Program.GetClient(); var eb = new EmbedBuilder(); eb.WithAuthor("Waifu Store", client.CurrentUser.GetAvatarUrl()); foreach (var x in waifus) { var efb = new EmbedFieldBuilder{ IsInline = true, Name = x.Waifu.Name, Value = $"TIER: **{x.Waifu.Tier}**\nPrice: {GetPriceString(x.Waifu.Tier, x.Discount)}" }; //efb.IsInline = true; //efb.Name = x.Waifu.Name; //efb.Value = $"TIER: **{x.Waifu.Tier}**\nPrice: {GetPriceString(x.Waifu.Tier, x.Discount)}"; if (x.Limited > -1) { efb.IsInline = false; efb.Value += "\n" + "**Limited!**"; if (x.Limited > 0) efb.Value += $" {x.Limited} in stock!"; else efb.Value += $" OUT OF STOCK! Bought by: {client.GetUser(x.BoughtBy).Mention}"; } eb.AddField(efb); } /////////////////////////// //INSERT THUMBNAIL /////////////////////////// eb.WithFooter($"{prefix}buywaifu [name] | Resets in {23 - DateTime.Now.Hour} Hours {60 - DateTime.Now.Minute} Minutes"); eb.Color = BasicUtil.RandomColor(); return eb; } public static EmbedBuilder WaifuShopEmbed(List<ShopWaifu> waifus, string prefix) { var client = Program.GetClient(); var eb = new EmbedBuilder(); eb.WithAuthor("Waifu Store", client.CurrentUser.GetAvatarUrl()); string list = ""; foreach (var x in waifus) { string src = x.Waifu.Source.Length > 33 ? (x.Waifu.Source.Substring(0, 30) + "...") : x.Waifu.Source; string listing = $"T{x.Waifu.Tier} {GetPriceString(x.Waifu.Tier, x.Discount)}: **{x.Waifu.Name}** - *{src}*\n"; if (x.Limited > -1) { listing += " **-Limited!**"; if (x.Limited > 0) listing += $" {x.Limited} in stock!\n"; else listing += $" OUT OF STOCK! Bought by: {client.GetUser(x.BoughtBy).Mention}\n"; list += listing; } else list += listing; } eb.WithDescription(list); eb.WithFooter($"`{prefix}buywaifu [name]` `{prefix}waifu [name]` | Resets in {23 - DateTime.Now.Hour} Hours {60 - DateTime.Now.Minute} Minutes"); eb.Color = BasicUtil.RandomColor(); return eb; }*/ public static EmbedBuilder NewShopEmbed(List<ShopWaifu> waifus, string prefix, ulong guildId = 0, ShopType type = ShopType.Waifu) { var client = Program.GetClient(); var eb = new EmbedBuilder(); if (type == ShopType.Gacha) eb.WithAuthor("Gacha Shop", client.CurrentUser.GetAvatarUrl(), LinkHelper.GetRedirectUrl(LinkHelper.Patreon, "Patreon", "cmd-embed-shop")); else if (type == ShopType.Mod) { eb.WithAuthor("Mod Shop", client.CurrentUser.GetAvatarUrl(), LinkHelper.GetRedirectUrl(LinkHelper.Patreon, "Patreon", "cmd-embed-shop")); eb.WithDescription($"A waifu shop controlled by server moderators.\n`{prefix}MsAddWaifu` | `{prefix}MsRemoveWaifu` - requires Namiko Pro Guild+."); } else { eb.WithAuthor("Waifu Shop", client.CurrentUser.GetAvatarUrl(), LinkHelper.GetRedirectUrl(LinkHelper.Patreon, "Patreon", "cmd-embed-shop")); if (guildId != 0) eb.WithDescription($"Open in [browser](https://namiko.moe/WaifuShop/{guildId})"); } string list = WaifuShopWaifuList(waifus); eb.AddField("\n:books: Commands", $"`{prefix}BuyWaifu [name]` | `{prefix}Waifu [search]` | `{prefix}Ws` | `{prefix}Gs` | `{prefix}Ms`", true); list = list.Any() ? list : "~ Shop Empty ~"; eb.AddField("<:MiaHug:536580304018735135> Waifus", list, false); //eb.WithThumbnailUrl(waifus[0].Waifu.ImageUrl); if (type != ShopType.Mod) eb.WithFooter($"Resets in {11 - DateTime.Now.Hour % 12} Hours {60 - DateTime.Now.Minute} Minutes"); eb.Color = BasicUtil.RandomColor(); return eb; }
public static EmbedBuilder DonateEmbed(string prefix) { var eb = new EmbedBuilder(); var client = Program.GetClient(); string desc = "Support the development of Namiko and get rewards!"; eb.WithDescription(desc); string field = ""; field += $"**Namiko Pro** - *5$*\n `{prefix}InfoPro`\n"; field += $"**Namiko Pro+** - *10$*\n `{prefix}InfoProPlus`\n"; eb.AddField("User Upgrades <:Pro:632544044643516416>", field, true); field = ""; field += $"**Pro Guild** - *5$*\n `{prefix}InfoGuild`\n"; field += $"**Pro Guild+** - *10$*\n `{prefix}InfoGuildPlus`\n"; eb.AddField("Server Wide Upgrades <:Guild:632544044660031498>", field, true); field = ""; field += $":star: [Patreon]({LinkHelper.GetRedirectUrl(LinkHelper.Patreon, "Patreon", "cmd-pro")}) - includes Pro.\n"; eb.AddField("Donation Links", field); eb.WithAuthor(client.CurrentUser); eb.WithColor(BasicUtil.RandomColor()); eb.WithFooter("-What are you? Twelve?"); eb.WithImageUrl(AppSettings.NamikoBannerUrl); return(eb); }
public static EmbedBuilder MangaEmbed(Manga manga) { string MangaState; if (manga.Status == "Publishing") { MangaState = "^"; } else { MangaState = manga.Chapters?.ToString(); } var eb = new EmbedBuilder(); eb.WithColor(BasicUtil.RandomColor()); eb.WithAuthor($"{manga.Title} ({manga.TitleJapanese})", MalIconUrl, manga.LinkCanonical); eb.WithFooter($"Results of manga search"); eb.WithCurrentTimestamp(); string desc = "**Type:** " + manga.Type + "\n**Manga score:** " + manga.Score + "\n**Status:** " + manga.Status + "\n**Chapters:** " + MangaState + "\n**Genres:** " + string.Join('/', manga.Genres) + "\n" + "\n" + manga.Synopsis; eb.WithDescription(desc.Length > 2040 ? desc.Substring(0, 2030) + "..." : desc); eb.ThumbnailUrl = manga.ImageURL; return(eb); }
public EmbedBuilder CommandHelpEmbed(CommandInfo commandInfo) { var eb = new EmbedBuilder(); eb.WithAuthor(commandInfo.Name); string desc = ""; //desc += $"**Name**: {commandInfo.Name}\n"; desc += $"**Aliases**: "; foreach (var x in commandInfo.Aliases) { desc += $"`{x}` "; } desc += "\n"; desc += $"**Description**: {commandInfo.Summary}\n"; desc += $"**Permissions**: "; foreach (var x in commandInfo.Preconditions) { desc += $"{x} "; } eb.WithColor(BasicUtil.RandomColor()); eb.WithDescription(desc); return(eb); }
public static EmbedBuilder RedditPostEmbed(Post post, string sub) { var eb = new EmbedBuilder() .WithColor(BasicUtil.RandomColor()) .WithAuthor(post.Title.ShortenString(200, 197), "https://i.imgur.com/GthCice.png", "https://www.reddit.com" + post.Permalink) .WithFooter("r/" + sub + " - " + post.UpVotes + " upvotes"); try { eb.WithDescription(((SelfPost)post).SelfText); } catch { } try { eb.WithImageUrl(((LinkPost)post).URL); } catch { } try { if (eb.Description == null && post.Comments.Top[0].UpVotes > 40) { eb.WithDescription(post.Comments.Top[0].Body); } } catch { } if (eb.Description == null && eb.ImageUrl == null) { return(null); } return(eb); }
private EmbedBuilder ModuleHelpEmbed(ModuleInfo moduleInfo) { if (moduleInfo == null) { return(null); } var eb = new EmbedBuilder(); eb.WithTitle(moduleInfo.Name); string desc = ""; foreach (var x in moduleInfo.Commands) { try { desc += $" **{x.Name}**\n{x.Summary}\n"; } catch { } } eb.WithColor(BasicUtil.RandomColor()); eb.WithDescription(desc); return(eb); }
public async Task SendAnnouncement(string name, int days) { var eb = await JsonHelper.ReadJson <EmbedBuilder>(Assembly.GetEntryAssembly().Location.Replace(@"Namiko.dll", $@"embeds/{name}")); eb.WithColor(BasicUtil.RandomColor()); using var db = new NamikoDbContext(); var voters = db.Voters.AsQueryable().Where(x => x.Date > DateTime.Now.AddDays(-days)).Select(x => x.UserId).ToHashSet(); int votes = db.Voters.AsQueryable().Where(x => x.Date > DateTime.Now.AddDays(-days)).Count(); await ReplyAsync($"Sending this to {voters.Count} users. Votes - {votes}"); await ReplyAsync(embed : eb.Build()); var client = Program.GetClient(); var embed = eb.Build(); int i = 0; foreach (var id in voters) { try { var ch = await client.GetUser(id).CreateDMChannelAsync(); await ch.SendMessageAsync(embed : embed); i++; } catch { } } await ReplyAsync($"Delivered to {i} users."); }
public async Task TestEmbed(string name) { var eb = await JsonHelper.ReadJson <EmbedBuilder>(Assembly.GetEntryAssembly().Location.Replace(@"Namiko.dll", $@"embeds/{name}")); eb.WithColor(BasicUtil.RandomColor()); await ReplyAsync(embed : eb.Build()); }
public EmbedBuilderLava(IUser author = null) : base() { WithColor(BasicUtil.RandomColor()); WithFooter($"Namiko 🌋 Lavalink"); string title = author != null ? $"{author.Username}#{author.Discriminator}" : "Player"; WithAuthor(title, author?.GetAvatarUrl(), LinkHelper.GetRedirectUrl(LinkHelper.Patreon, "Patreon", "cmd-lavalink")); }
public EmbedBuilderPrepared(IUser author = null) : base() { WithColor(BasicUtil.RandomColor()); if (author != null) { WithAuthor(author.Username + "#" + author.Discriminator, author.GetAvatarUrl(), LinkHelper.GetRedirectUrl(LinkHelper.Patreon, "Patreon", "cmd-embed-author")); } }
public static EmbedBuilder GiveEmbed(IUser from, IUser to, int amount) { EmbedBuilder eb = new EmbedBuilder(); eb.AddField("Toasties <:toastie3:454441133876183060>", $"{from.Username} gave {to.Username} **{amount.ToString("n0")}** {ToastieUtil.RandomEmote()}!"); eb.WithColor(BasicUtil.RandomColor()); return(eb); }
public static EmbedBuilder NoBoxEmbed(IUser author) { var eb = new EmbedBuilder(); eb.WithAuthor(author); eb.WithColor(BasicUtil.RandomColor()); eb.WithDescription($"You have no lootboxes!\nVote for me on [Discord Bots]({LinkHelper.GetRedirectUrl(LinkHelper.Vote, "Vote", "cmd-lootbox")}) to get one!"); return(eb); }
public async Task SellWaifu([Remainder] string str = "") { var waifu = await WaifuUtil.ProcessWaifuListAndRespond(await WaifuDb.SearchWaifus(str, false, UserInventoryDb.GetWaifus(Context.User.Id, Context.Guild.Id)), this); //waifus existance if (waifu == null) { return; } int worth = WaifuUtil.GetSalePrice(waifu.Tier); var sell = new DialogueBoxOption(); sell.Action = async(IUserMessage message) => { if (!UserInventoryDb.OwnsWaifu(Context.User.Id, waifu, Context.Guild.Id)) { await message.ModifyAsync(x => { x.Embed = new EmbedBuilderPrepared(Context.User).WithDescription("You tried :star:").Build(); }); return; } try { await BalanceDb.AddToasties(Context.User.Id, worth, Context.Guild.Id); } catch (Exception ex) { await Context.Channel.SendMessageAsync(ex.Message); } //removing waifu + confirmation await UserInventoryDb.DeleteWaifu(Context.User.Id, waifu, Context.Guild.Id); await message.ModifyAsync(x => { x.Content = $"You sold **{waifu.Name}** for **{worth.ToString("n0")}** toasties."; x.Embed = ToastieUtil.ToastieEmbed(Context.User, BalanceDb.GetToasties(Context.User.Id, Context.Guild.Id)).Build(); }); }; sell.After = OnExecute.RemoveReactions; var cancel = new DialogueBoxOption(); cancel.After = OnExecute.Delete; var dia = new DialogueBox(); dia.Options.Add(Emote.Parse("<:TickYes:577838859107303424>"), sell); dia.Options.Add(Emote.Parse("<:TickNo:577838859077943306>"), cancel); dia.Timeout = new TimeSpan(0, 1, 0); dia.Embed = new EmbedBuilder() .WithAuthor(Context.User) .WithColor(BasicUtil.RandomColor()) .WithDescription($"Sell **{waifu.Name}** for **{worth.ToString("n0")}** toasties?").Build(); await DialogueReplyAsync(dia); return; }
public static EmbedBuilder BoxOpeningEmbed(IUser author) { var eb = new EmbedBuilder(); eb.WithAuthor(author); eb.WithColor(BasicUtil.RandomColor()); eb.WithTitle("Opening your lootbox!"); eb.WithImageUrl("https://data.whicdn.com/images/109950962/original.gif"); return(eb); }
public async Task SendEmbed(string name, ulong id) { var eb = await JsonHelper.ReadJson <EmbedBuilder>(Assembly.GetEntryAssembly().Location.Replace(@"Namiko.dll", $@"embeds/{name}")); eb.WithColor(BasicUtil.RandomColor()); ISocketMessageChannel ch = Context.Client.GetChannel(id) as ISocketMessageChannel; await ch.SendMessageAsync(embed : eb.Build()); await Context.Channel.SendMessageAsync($"Saying in {ch.Name}", false, embed : eb.Build()); }
public static EmbedBuilder ToEmbed(ReactionImage img) { EmbedBuilder embed = new EmbedBuilder(); string path = $"{AppSettings.ImageUrlPath + "reaction/"}{img.Name}{(img.GuildId > 0 ? "/" + img.GuildId.ToString() : "")}/{img.Id}.{img.ImageFileType}"; embed.WithImageUrl(path); embed.WithFooter($"{img.Name} id: {img.Id}"); embed.WithColor(BasicUtil.RandomColor()); return(embed); }
// REDDIT public static EmbedBuilder SubredditSubscribedEmbed(Subreddit sub, int upvotes) { var eb = new EmbedBuilder(); eb.WithAuthor(sub.Title, sub.CommunityIcon, "https://www.reddit.com" + sub.URL); try { eb.WithImageUrl(sub.BannerImg); } catch { } eb.WithDescription($"Subscribed to hot posts from **{sub.Name}** that reach **{upvotes}** or more upvotes."); eb.WithColor(BasicUtil.RandomColor()); eb.WithFooter($"Type `!unsub {sub.Name}` to unsubscribe."); return(eb); }
public async Task TestAnnouncement(string name, int days) { var eb = await JsonHelper.ReadJson <EmbedBuilder>(Assembly.GetEntryAssembly().Location.Replace(@"Namiko.dll", $@"embeds/{name}")); eb.WithColor(BasicUtil.RandomColor()); using var db = new NamikoDbContext(); var voters = db.Voters.AsQueryable().Where(x => x.Date > DateTime.Now.AddDays(-days)).Select(x => x.UserId).ToHashSet(); int votes = db.Voters.AsQueryable().Where(x => x.Date > DateTime.Now.AddDays(-days)).Count(); await ReplyAsync($"Sending this to {voters.Count} users. Votes - {votes}"); await ReplyAsync(embed : eb.Build()); }
public static EmbedBuilder SauceEmbed(Sauce sauce, string requestUrl) { var eb = new EmbedBuilder(); string desc = "**Results:**\n"; foreach (var x in sauce.Results) { desc += $"• {x.Similarity}% - [{x.DatabaseName}]({x.SourceURL ?? x.InnerSource})"; if (x.InnerSource != null && x.SourceURL != null) { if (IsValidUrl(x.InnerSource)) { desc += $" -> [{GetDomainFromUrl(x.InnerSource)}]({x.InnerSource})\n"; } else { desc += $" -> {x.InnerSource}\n"; } } if (!desc.EndsWith("\n")) { desc += "\n"; } if (x.ExtUrls != null) { x.ExtUrls.Remove(x.InnerSource); x.ExtUrls.Remove(x.SourceURL); if (x.ExtUrls.Count > 0) { desc += $"Extra: "; foreach (var url in x.ExtUrls) { if (IsValidUrl(url)) { desc += $"[{GetDomainFromUrl(url)}]({url}) "; } } desc += "\n"; } } } eb.WithDescription(desc); eb.WithThumbnailUrl(requestUrl); eb.WithAuthor("SauceNao", "http://www.userlogos.org/files/logos/zoinzberg/SauceNAO_2.png", "https://saucenao.com/"); eb.WithColor(BasicUtil.RandomColor()); return(eb); }
public static EmbedBuilder WeeklyGetEmbed(int amount, int current, IUser user, string prefix) { var eb = new EmbedBuilder(); eb.WithAuthor(user.ToString(), user.GetAvatarUrl(), LinkHelper.GetRedirectUrl(LinkHelper.Patreon, "Patreon", "cmd-embed-weekly")); eb.WithDescription($"You received **{amount.ToString("n0")}** {RandomEmote()}\nNow you have **{current.ToString("n0")}** {RandomEmote()}"); eb.WithColor(BasicUtil.RandomColor()); if (!(PremiumDb.IsPremium(user.Id, ProType.Pro) || PremiumDb.IsPremium(user.Id, ProType.ProPlus))) { eb.WithFooter($"Check out Pro upgrades! `{prefix}Pro`"); } return(eb); }
private async Task SendWaifuUpdatedMessage(Waifu waifu, string field, string oldVal, string newVal) { var author = Context.User; newVal = newVal == null || newVal == "" ? "-" : newVal.ShortenString(1000, 1000, " ..."); oldVal = oldVal == null || oldVal == "" ? "-" : oldVal.ShortenString(1000, 1000, " ..."); var eb = new EmbedBuilder() .WithAuthor($"{waifu.Name} - {field} updated", waifu.HostImageUrl) .AddField("New", newVal, true) .AddField("Old", oldVal, true) .WithColor(BasicUtil.RandomColor()) .WithFooter(author.Username + "#" + author.Discriminator, author.GetAvatarUrl()); await Context.Channel.SendMessageAsync(embed : eb.Build()); }
public static EmbedBuilder DailyGetEmbed(IUser user, int streak, int amount, int balance, string prefix) { var eb = new EmbedBuilder(); eb.WithAuthor(user.ToString(), user.GetAvatarUrl(), LinkHelper.GetRedirectUrl(LinkHelper.Patreon, "Patreon", "cmd-embed-daily")); eb.WithDescription($"You're on a **{streak.ToString("n0")}** day streak. You receive **{amount.ToString("n0")}** {ToastieUtil.RandomEmote()}\n" + $"Now you have **{balance.ToString("n0")}** {ToastieUtil.RandomEmote()}\n\n" + $"Vote for me on [Discord Bots]({LinkHelper.GetRedirectUrl(LinkHelper.Vote, "Vote", "cmd-daily")}) every day to receive a lootbox!"); eb.WithColor(BasicUtil.RandomColor()); if (!(PremiumDb.IsPremium(user.Id, ProType.Pro) || PremiumDb.IsPremium(user.Id, ProType.ProPlus))) { eb.WithFooter($"Check out Pro upgrades! `{prefix}Pro`"); } return(eb); }
public static EmbedBuilder TeamEmbed(SocketRole teamRole, SocketRole leaderRole) { var eb = new EmbedBuilder(); List <SocketGuildUser> leaderUsers = new List <SocketGuildUser>(leaderRole.Members); List <SocketGuildUser> teamUsers = new List <SocketGuildUser>(teamRole.Members); teamUsers.RemoveAll(x => leaderUsers.Any(y => y.Equals(x))); int totalToasties = 0; int totalWaifus = 0; int totalWaifuValue = 0; string memberList = ""; foreach (var x in teamUsers) { memberList += $"\n`{x.Username}`"; totalToasties += BalanceDb.GetToasties(x.Id, x.Guild.Id); var waifus = UserInventoryDb.GetWaifus(x.Id, x.Guild.Id); totalWaifus += waifus.Count; totalWaifuValue += WaifuUtil.WaifuValue(waifus); } string leaderList = ""; foreach (var x in leaderUsers) { leaderList += $"\n`{x.Username}`"; totalToasties += BalanceDb.GetToasties(x.Id, x.Guild.Id); var waifus = UserInventoryDb.GetWaifus(x.Id, x.Guild.Id); totalWaifus += waifus.Count; totalWaifuValue += WaifuUtil.WaifuValue(waifus); } eb.WithDescription($"Total Toasties: {totalToasties.ToString("n0")} <:toastie3:454441133876183060>\n" + $"Total Waifus: {totalWaifus.ToString("n0")} :two_hearts:\n" + $"Waifu Value: {totalWaifuValue.ToString("n0")} <:toastie3:454441133876183060>"); eb.AddField($":shield: Members - {teamUsers.Count}", memberList == "" ? "-" : memberList, true); eb.AddField($":crown: Leaders - {leaderUsers.Count}", leaderList == "" ? "-" : leaderList, true); eb.WithColor(BasicUtil.RandomColor()); eb.WithTitle(teamRole.Name); return(eb); }
// WEEKLIES public static EmbedBuilder WeeklyWaitEmbed(DateTime date, IUser user, string prefix) { var eb = new EmbedBuilder(); eb.WithAuthor(user.ToString(), user.GetAvatarUrl(), LinkHelper.GetRedirectUrl(LinkHelper.Patreon, "Patreon", "cmd-embed-weekly")); DateTime now = DateTime.Now; string wait = $"{(date - now).Days} Days {(date - now).Hours} Hours {(date - now).Minutes} Minutes"; eb.WithDescription($"You already claimed your weekly reward.\nYou must wait `{wait}`"); eb.WithColor(BasicUtil.RandomColor()); if (!(PremiumDb.IsPremium(user.Id, ProType.Pro) || PremiumDb.IsPremium(user.Id, ProType.ProPlus))) { eb.WithFooter($"Check out Pro upgrades! `{prefix}Pro`"); } return(eb); }
public static EmbedBuilder DailyWaitEmbed(IUser user, int hours, int minutes, int seconds, string prefix) { var eb = new EmbedBuilder(); eb.WithAuthor(user.ToString(), user.GetAvatarUrl(), LinkHelper.GetRedirectUrl(LinkHelper.Patreon, "Patreon", "cmd-embed-daily")); eb.WithDescription($"You already claimed your daily reward today.\nYou must wait `{hours} hours {minutes} minutes {seconds} seconds`"); if (new Random().Next(20) == 1) { eb.WithImageUrl("https://i.imgur.com/LcqpKmo.png"); } eb.WithColor(BasicUtil.RandomColor()); if (!(PremiumDb.IsPremium(user.Id, ProType.Pro) || PremiumDb.IsPremium(user.Id, ProType.ProPlus))) { eb.WithFooter($"Check out Pro upgrades! `{prefix}Pro`"); } return(eb); }
public async static Task <EmbedBuilder> NowPlayingEmbed(LavaPlayer player, bool next = false) { var eb = new EmbedBuilder(); var track = player.Track; string emote = "▷"; if (player.Repeat) { emote = ":repeat_one: ▷"; } string desc; if (player.Track.IsStream) { desc = $"{emote} `Live Stream`"; } else { string format = track.Duration.TotalSeconds >= 3600 ? @"hh\:mm\:ss" : @"mm\:ss"; desc = $"{emote} `{track.Position.ToString(format)}`/`{track.Duration.ToString(format)}`"; } if (track.User != null) { desc += $" - {track.User?.Mention ?? ""}"; } var url = track.Url.ToString().StartsWith("file:") ? "" : track.Url.ToString(); eb.WithAuthor(track.Title, track.User?.GetAvatarUrl(), url); eb.WithDescription(desc); if (next && player.Queue.Count > 0) { eb.AddField("Next up:", $"[{player.Queue.Peek().Title}]({player.Queue.Peek().Url})"); } eb.WithThumbnailUrl(await track.FetchArtworkAsync()); eb.WithFooter($"Volume: {player.Volume} ⚬ Powered by: 🌋 Victoria - Lavalink"); eb.WithColor(BasicUtil.RandomColor()); return(eb); }
public async Task InfoGuild([Remainder] string str = "") { string prefix = Program.GetPrefix(Context); var eb = new EmbedBuilder() .WithAuthor(Program.GetClient().CurrentUser) .WithDescription($"Namiko Pro Guild Upgrades :star:\n" + $"\n" + $"- **Music** with a lot of features! Try `{prefix}join`\n" + $"- Halved `{prefix}weekly` cooldown\n" + $"- **3** times more waifus in waifu shop and gacha shop\n" + $"- Subreddit follow limit increased to **5**\n" + $"\n" + $":star: Subscribe on [Patreon]({LinkHelper.GetRedirectUrl(LinkHelper.Patreon, "Patreon", "cmd-info-guild")})") .WithImageUrl("https://i.imgur.com/XxFJ1gH.png") .WithFooter("-What are you? Twelve?") .WithColor(BasicUtil.RandomColor()); await Context.Channel.SendMessageAsync("", false, eb.Build()); }
public async Task InfoPro([Remainder] string str = "") { string prefix = Program.GetPrefix(Context); var eb = new EmbedBuilder() .WithAuthor(Program.GetClient().CurrentUser) .WithDescription($"Namiko Pro Upgrades :star:\n" + $"\n" + $"- Waifus from your wishlist have a much higher chance to appear in the `{prefix}waifushop`\n" + $"- Much higher chance to find waifus from your wishlist in your lootboxes\n" + $"- Get upgraded lootboxes for voting: chance to get **T1** and **T2** waifus, more toasties.\n" + $"- Marry up to **3** users\n" + $"\n" + $":star: Subscribe on [Patreon]({LinkHelper.GetRedirectUrl(LinkHelper.Patreon, "Patreon", "cmd-info-pro")})") .WithImageUrl("https://i.imgur.com/NIAP5QC.png") .WithFooter("-What are you? Twelve?") .WithColor(BasicUtil.RandomColor()); await Context.Channel.SendMessageAsync("", false, eb.Build()); }
public static CustomPaginatedMessage PaginatedShopMessage(IEnumerable<ShopWaifu> waifus, int pageSize, string prefix, ulong guildId = 0, ShopType type = ShopType.Waifu) { CustomPaginatedMessage paginatedMessage = new CustomPaginatedMessage(); var fieldList = new List<FieldPages>(); var splitWaifus = CustomPaginatedMessage.Split(waifus, pageSize); int pages = splitWaifus.Count(); var fieldInfo = new FieldPages(); var pagelist = new List<string>(); fieldInfo.Title = ":books: Commands"; for (int i = 0; i < pages; i++) { pagelist.Add($"`{prefix}BuyWaifu [name]` | `{prefix}Waifu [search]` | `{prefix}Ws` | `{prefix}Gs` | `{prefix}Ms`"); } fieldInfo.Inline = true; fieldInfo.Pages = pagelist; fieldList.Add(fieldInfo); var fieldWaifus = new FieldPages(); var pagelist2 = new List<string>(); fieldWaifus.Title = "<:MiaHug:536580304018735135> Waifus"; foreach (var w in splitWaifus) { pagelist2.Add(WaifuUtil.WaifuShopWaifuList(w)); } fieldWaifus.Pages = pagelist2; fieldList.Add(fieldWaifus); paginatedMessage.Fields = fieldList; paginatedMessage.Footer = $"Resets in {11 - DateTime.Now.Hour % 12} Hours {60 - DateTime.Now.Minute} Minutes | "; paginatedMessage.Color = BasicUtil.RandomColor(); paginatedMessage.PageCount = pages; if (guildId != 0) paginatedMessage.Pages = new List<string> { $"Open in [browser](https://namiko.moe/WaifuShop/{guildId})" }; paginatedMessage.Author = new EmbedAuthorBuilder() { Name = type switch { ShopType.Waifu => "Waifu Shop", ShopType.Gacha => "Gacha Shop", ShopType.Mod => "Mod Shop", _ => "Waifu Shop" },