mirror of
				https://gitlab.com/Kwoth/nadekobot.git
				synced 2025-11-03 16:24:27 -05:00 
			
		
		
		
	All .AddField calls no longer use builder
- Cleaned up convertlist and listserver embeds slightly
This commit is contained in:
		@@ -235,14 +235,10 @@ namespace NadekoBot.Modules.Administration
 | 
			
		||||
                    .WithTitle(GetText("prot_active"));
 | 
			
		||||
 | 
			
		||||
                if (spam != null)
 | 
			
		||||
                    embed.AddField(efb => efb.WithName("Anti-Spam")
 | 
			
		||||
                        .WithValue(GetAntiSpamString(spam).TrimTo(1024))
 | 
			
		||||
                        .WithIsInline(true));
 | 
			
		||||
                    embed.AddField("Anti-Spam", GetAntiSpamString(spam).TrimTo(1024), true);
 | 
			
		||||
 | 
			
		||||
                if (raid != null)
 | 
			
		||||
                    embed.AddField(efb => efb.WithName("Anti-Raid")
 | 
			
		||||
                        .WithValue(GetAntiRaidString(raid).TrimTo(1024))
 | 
			
		||||
                        .WithIsInline(true));
 | 
			
		||||
                    embed.AddField("Anti-Raid", GetAntiRaidString(raid).TrimTo(1024), true);
 | 
			
		||||
 | 
			
		||||
                if (alt is not null)
 | 
			
		||||
                    embed.AddField("Anti-Alt", GetAntiAltString(alt), true);
 | 
			
		||||
 
 | 
			
		||||
@@ -59,12 +59,9 @@ namespace NadekoBot.Modules.Administration
 | 
			
		||||
 | 
			
		||||
                await ctx.Channel.EmbedAsync(new EmbedBuilder().WithOkColor()
 | 
			
		||||
                    .WithTitle(GetText("scadd"))
 | 
			
		||||
                    .AddField(efb => efb.WithName(GetText("server"))
 | 
			
		||||
                        .WithValue(cmd.GuildId is null ? $"-" : $"{cmd.GuildName}/{cmd.GuildId}").WithIsInline(true))
 | 
			
		||||
                    .AddField(efb => efb.WithName(GetText("channel"))
 | 
			
		||||
                        .WithValue($"{cmd.ChannelName}/{cmd.ChannelId}").WithIsInline(true))
 | 
			
		||||
                    .AddField(efb => efb.WithName(GetText("command_text"))
 | 
			
		||||
                        .WithValue(cmdText).WithIsInline(false))).ConfigureAwait(false);
 | 
			
		||||
                    .AddField(GetText("server"), cmd.GuildId is null ? $"-" : $"{cmd.GuildName}/{cmd.GuildId}", true)
 | 
			
		||||
                    .AddField(GetText("channel"), $"{cmd.ChannelName}/{cmd.ChannelId}", true)
 | 
			
		||||
                    .AddField(GetText("command_text"), cmdText, false));
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            [NadekoCommand, Aliases]
 | 
			
		||||
 
 | 
			
		||||
@@ -595,12 +595,10 @@ namespace NadekoBot.Modules.Administration.Services
 | 
			
		||||
                        if (before.Nickname != after.Nickname)
 | 
			
		||||
                        {
 | 
			
		||||
                            embed.WithAuthor("👥 " + GetText(logChannel.Guild, "nick_change"))
 | 
			
		||||
                                .AddField(efb =>
 | 
			
		||||
                                    efb.WithName(GetText(logChannel.Guild, "old_nick"))
 | 
			
		||||
                                        .WithValue($"{before.Nickname}#{before.Discriminator}"))
 | 
			
		||||
                                .AddField(efb =>
 | 
			
		||||
                                    efb.WithName(GetText(logChannel.Guild, "new_nick"))
 | 
			
		||||
                                        .WithValue($"{after.Nickname}#{after.Discriminator}"));
 | 
			
		||||
                                .AddField(GetText(logChannel.Guild, "old_nick")
 | 
			
		||||
                                    , $"{before.Nickname}#{before.Discriminator}")
 | 
			
		||||
                                .AddField(GetText(logChannel.Guild, "new_nick")
 | 
			
		||||
                                    , $"{after.Nickname}#{after.Discriminator}");
 | 
			
		||||
 | 
			
		||||
                            await logChannel.EmbedAsync(embed).ConfigureAwait(false);
 | 
			
		||||
                        }
 | 
			
		||||
@@ -703,19 +701,14 @@ namespace NadekoBot.Modules.Administration.Services
 | 
			
		||||
                    {
 | 
			
		||||
                        embed.WithTitle("ℹ️ " + GetText(logChannel.Guild, "ch_name_change"))
 | 
			
		||||
                            .WithDescription($"{after} | {after.Id}")
 | 
			
		||||
                            .AddField(efb =>
 | 
			
		||||
                                efb.WithName(GetText(logChannel.Guild, "ch_old_name")).WithValue(before.Name));
 | 
			
		||||
                            .AddField(GetText(logChannel.Guild, "ch_old_name"), before.Name);
 | 
			
		||||
                    }
 | 
			
		||||
                    else if (beforeTextChannel?.Topic != afterTextChannel?.Topic)
 | 
			
		||||
                    {
 | 
			
		||||
                        embed.WithTitle("ℹ️ " + GetText(logChannel.Guild, "ch_topic_change"))
 | 
			
		||||
                            .WithDescription($"{after} | {after.Id}")
 | 
			
		||||
                            .AddField(efb =>
 | 
			
		||||
                                efb.WithName(GetText(logChannel.Guild, "old_topic"))
 | 
			
		||||
                                    .WithValue(beforeTextChannel?.Topic ?? "-"))
 | 
			
		||||
                            .AddField(efb =>
 | 
			
		||||
                                efb.WithName(GetText(logChannel.Guild, "new_topic"))
 | 
			
		||||
                                    .WithValue(afterTextChannel?.Topic ?? "-"));
 | 
			
		||||
                            .AddField(GetText(logChannel.Guild, "old_topic") , beforeTextChannel?.Topic ?? "-")
 | 
			
		||||
                            .AddField(GetText(logChannel.Guild, "new_topic"), afterTextChannel?.Topic ?? "-");
 | 
			
		||||
                    }
 | 
			
		||||
                    else
 | 
			
		||||
                        return;
 | 
			
		||||
@@ -931,7 +924,7 @@ namespace NadekoBot.Modules.Administration.Services
 | 
			
		||||
                        .WithOkColor()
 | 
			
		||||
                        .WithTitle("❌ " + GetText(logChannel.Guild, "user_left"))
 | 
			
		||||
                        .WithDescription(usr.ToString())
 | 
			
		||||
                        .AddField(efb => efb.WithName("Id").WithValue(usr.Id.ToString()))
 | 
			
		||||
                        .AddField("Id", usr.Id.ToString())
 | 
			
		||||
                        .WithFooter(CurrentTime(usr.Guild));
 | 
			
		||||
 | 
			
		||||
                    if (Uri.IsWellFormedUriString(usr.GetAvatarUrl(), UriKind.Absolute))
 | 
			
		||||
@@ -966,13 +959,13 @@ namespace NadekoBot.Modules.Administration.Services
 | 
			
		||||
                        .WithOkColor()
 | 
			
		||||
                        .WithTitle("✅ " + GetText(logChannel.Guild, "user_joined"))
 | 
			
		||||
                        .WithDescription($"{usr.Mention} `{usr}`")
 | 
			
		||||
                        .AddField(efb => efb.WithName("Id").WithValue(usr.Id.ToString()))
 | 
			
		||||
                        .AddField(fb =>
 | 
			
		||||
                            fb.WithName(GetText(logChannel.Guild, "joined_server"))
 | 
			
		||||
                                .WithValue($"{usr.JoinedAt?.ToString("dd.MM.yyyy HH:mm") ?? "?"}").WithIsInline(true))
 | 
			
		||||
                        .AddField(fb =>
 | 
			
		||||
                            fb.WithName(GetText(logChannel.Guild, "joined_discord"))
 | 
			
		||||
                                .WithValue($"{usr.CreatedAt:dd.MM.yyyy HH:mm}").WithIsInline(true))
 | 
			
		||||
                        .AddField("Id", usr.Id.ToString())
 | 
			
		||||
                        .AddField(GetText(logChannel.Guild, "joined_server"),
 | 
			
		||||
                            $"{usr.JoinedAt?.ToString("dd.MM.yyyy HH:mm" ?? "?")}",
 | 
			
		||||
                            true)
 | 
			
		||||
                        .AddField(GetText(logChannel.Guild, "joined_discord"),
 | 
			
		||||
                            $"{usr.CreatedAt:dd.MM.yyyy HH:mm}",
 | 
			
		||||
                            true)
 | 
			
		||||
                        .WithFooter(CurrentTime(usr.Guild));
 | 
			
		||||
 | 
			
		||||
                    if (Uri.IsWellFormedUriString(usr.GetAvatarUrl(), UriKind.Absolute))
 | 
			
		||||
@@ -1006,7 +999,7 @@ namespace NadekoBot.Modules.Administration.Services
 | 
			
		||||
                        .WithOkColor()
 | 
			
		||||
                        .WithTitle("♻️ " + GetText(logChannel.Guild, "user_unbanned"))
 | 
			
		||||
                        .WithDescription(usr.ToString())
 | 
			
		||||
                        .AddField(efb => efb.WithName("Id").WithValue(usr.Id.ToString()))
 | 
			
		||||
                        .AddField("Id", usr.Id.ToString())
 | 
			
		||||
                        .WithFooter(CurrentTime(guild));
 | 
			
		||||
 | 
			
		||||
                    if (Uri.IsWellFormedUriString(usr.GetAvatarUrl(), UriKind.Absolute))
 | 
			
		||||
@@ -1041,7 +1034,7 @@ namespace NadekoBot.Modules.Administration.Services
 | 
			
		||||
                        .WithOkColor()
 | 
			
		||||
                        .WithTitle("🚫 " + GetText(logChannel.Guild, "user_banned"))
 | 
			
		||||
                        .WithDescription(usr.ToString())
 | 
			
		||||
                        .AddField(efb => efb.WithName("Id").WithValue(usr.Id.ToString()))
 | 
			
		||||
                        .AddField("Id", usr.Id.ToString())
 | 
			
		||||
                        .WithFooter(CurrentTime(guild));
 | 
			
		||||
 | 
			
		||||
                    var avatarUrl = usr.GetAvatarUrl();
 | 
			
		||||
@@ -1090,16 +1083,15 @@ namespace NadekoBot.Modules.Administration.Services
 | 
			
		||||
                        .WithOkColor()
 | 
			
		||||
                        .WithTitle("🗑 " + GetText(logChannel.Guild, "msg_del", ((ITextChannel) msg.Channel).Name))
 | 
			
		||||
                        .WithDescription(msg.Author.ToString())
 | 
			
		||||
                        .AddField(efb =>
 | 
			
		||||
                            efb.WithName(GetText(logChannel.Guild, "content"))
 | 
			
		||||
                                .WithValue(string.IsNullOrWhiteSpace(resolvedMessage) ? "-" : resolvedMessage)
 | 
			
		||||
                                .WithIsInline(false))
 | 
			
		||||
                        .AddField(GetText(logChannel.Guild, "content"),
 | 
			
		||||
                            string.IsNullOrWhiteSpace(resolvedMessage) ? "-" : resolvedMessage,
 | 
			
		||||
                            false)
 | 
			
		||||
                        .AddField("Id", msg.Id.ToString(), false)
 | 
			
		||||
                        .WithFooter(CurrentTime(channel.Guild));
 | 
			
		||||
                    if (msg.Attachments.Any())
 | 
			
		||||
                        embed.AddField(efb =>
 | 
			
		||||
                            efb.WithName(GetText(logChannel.Guild, "attachments"))
 | 
			
		||||
                                .WithValue(string.Join(", ", msg.Attachments.Select(a => a.Url))).WithIsInline(false));
 | 
			
		||||
                        embed.AddField(GetText(logChannel.Guild, "attachments"),
 | 
			
		||||
                            string.Join(", ", msg.Attachments.Select(a => a.Url)),
 | 
			
		||||
                            false);
 | 
			
		||||
 | 
			
		||||
                    await logChannel.EmbedAsync(embed).ConfigureAwait(false);
 | 
			
		||||
                }
 | 
			
		||||
@@ -1146,18 +1138,19 @@ namespace NadekoBot.Modules.Administration.Services
 | 
			
		||||
 | 
			
		||||
                    var embed = new EmbedBuilder()
 | 
			
		||||
                        .WithOkColor()
 | 
			
		||||
                        .WithTitle("📝 " + GetText(logChannel.Guild, "msg_update", ((ITextChannel) after.Channel).Name))
 | 
			
		||||
                        .WithTitle("📝 " + GetText(logChannel.Guild, "msg_update", ((ITextChannel)after.Channel).Name))
 | 
			
		||||
                        .WithDescription(after.Author.ToString())
 | 
			
		||||
                        .AddField(efb =>
 | 
			
		||||
                            efb.WithName(GetText(logChannel.Guild, "old_msg"))
 | 
			
		||||
                                .WithValue(string.IsNullOrWhiteSpace(before.Content)
 | 
			
		||||
                                    ? "-"
 | 
			
		||||
                                    : before.Resolve(userHandling: TagHandling.FullName)).WithIsInline(false))
 | 
			
		||||
                        .AddField(efb =>
 | 
			
		||||
                            efb.WithName(GetText(logChannel.Guild, "new_msg"))
 | 
			
		||||
                                .WithValue(string.IsNullOrWhiteSpace(after.Content)
 | 
			
		||||
                                    ? "-"
 | 
			
		||||
                                    : after.Resolve(userHandling: TagHandling.FullName)).WithIsInline(false))
 | 
			
		||||
                        .AddField(GetText(logChannel.Guild, "old_msg"),
 | 
			
		||||
                            string.IsNullOrWhiteSpace(before.Content)
 | 
			
		||||
                                ? "-"
 | 
			
		||||
                                : before.Resolve(userHandling: TagHandling.FullName),
 | 
			
		||||
                            false)
 | 
			
		||||
                        .AddField(
 | 
			
		||||
                            GetText(logChannel.Guild, "new_msg"),
 | 
			
		||||
                            string.IsNullOrWhiteSpace(after.Content)
 | 
			
		||||
                                ? "-"
 | 
			
		||||
                                : after.Resolve(userHandling: TagHandling.FullName),
 | 
			
		||||
                            false)
 | 
			
		||||
                        .AddField("Id", after.Id.ToString(), false)
 | 
			
		||||
                        .WithFooter(CurrentTime(channel.Guild));
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -62,8 +62,8 @@ namespace NadekoBot.Modules.Administration
 | 
			
		||||
                {
 | 
			
		||||
                    await (await user.GetOrCreateDMChannelAsync().ConfigureAwait(false)).EmbedAsync(new EmbedBuilder().WithErrorColor()
 | 
			
		||||
                                     .WithDescription(GetText("warned_on", ctx.Guild.ToString()))
 | 
			
		||||
                                     .AddField(efb => efb.WithName(GetText("moderator")).WithValue(ctx.User.ToString()))
 | 
			
		||||
                                     .AddField(efb => efb.WithName(GetText("reason")).WithValue(reason ?? "-")))
 | 
			
		||||
                                     .AddField(GetText("moderator"), ctx.User.ToString())
 | 
			
		||||
                                     .AddField(GetText("reason"), reason ?? "-"))
 | 
			
		||||
                        .ConfigureAwait(false);
 | 
			
		||||
                }
 | 
			
		||||
                catch
 | 
			
		||||
 
 | 
			
		||||
@@ -44,8 +44,8 @@ namespace NadekoBot.Modules.CustomReactions
 | 
			
		||||
            await ctx.Channel.EmbedAsync(new EmbedBuilder().WithOkColor()
 | 
			
		||||
                .WithTitle(GetText("new_cust_react"))
 | 
			
		||||
                .WithDescription($"#{(kwum)cr.Id}")
 | 
			
		||||
                .AddField(efb => efb.WithName(GetText("trigger")).WithValue(key))
 | 
			
		||||
                .AddField(efb => efb.WithName(GetText("response")).WithValue(message.Length > 1024 ? GetText("redacted_too_long") : message))
 | 
			
		||||
                .AddField(GetText("trigger"), key)
 | 
			
		||||
                .AddField(GetText("response"), message.Length > 1024 ? GetText("redacted_too_long") : message)
 | 
			
		||||
                ).ConfigureAwait(false);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@@ -68,8 +68,8 @@ namespace NadekoBot.Modules.CustomReactions
 | 
			
		||||
                await ctx.Channel.EmbedAsync(new EmbedBuilder().WithOkColor()
 | 
			
		||||
                    .WithTitle(GetText("edited_cust_react"))
 | 
			
		||||
                    .WithDescription($"#{id}")
 | 
			
		||||
                    .AddField(efb => efb.WithName(GetText("trigger")).WithValue(cr.Trigger))
 | 
			
		||||
                    .AddField(efb => efb.WithName(GetText("response")).WithValue(message.Length > 1024 ? GetText("redacted_too_long") : message))
 | 
			
		||||
                    .AddField(GetText("trigger"), cr.Trigger)
 | 
			
		||||
                    .AddField(GetText("response"), message.Length > 1024 ? GetText("redacted_too_long") : message)
 | 
			
		||||
                    ).ConfigureAwait(false);
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
@@ -148,8 +148,8 @@ namespace NadekoBot.Modules.CustomReactions
 | 
			
		||||
            {
 | 
			
		||||
                await ctx.Channel.EmbedAsync(new EmbedBuilder().WithOkColor()
 | 
			
		||||
                    .WithDescription($"#{id}")
 | 
			
		||||
                    .AddField(efb => efb.WithName(GetText("trigger")).WithValue(found.Trigger.TrimTo(1024)))
 | 
			
		||||
                    .AddField(efb => efb.WithName(GetText("response")).WithValue((found.Response + "\n```css\n" + found.Response).TrimTo(1020) + "```"))
 | 
			
		||||
                    .AddField(GetText("trigger"), found.Trigger.TrimTo(1024))
 | 
			
		||||
                    .AddField(GetText("response"), (found.Response + "\n```css\n" + found.Response).TrimTo(1020) + "```")
 | 
			
		||||
                    ).ConfigureAwait(false);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
@@ -170,8 +170,8 @@ namespace NadekoBot.Modules.CustomReactions
 | 
			
		||||
                await ctx.Channel.EmbedAsync(new EmbedBuilder().WithOkColor()
 | 
			
		||||
                    .WithTitle(GetText("deleted"))
 | 
			
		||||
                    .WithDescription($"#{id}")
 | 
			
		||||
                    .AddField(efb => efb.WithName(GetText("trigger")).WithValue(cr.Trigger.TrimTo(1024)))
 | 
			
		||||
                    .AddField(efb => efb.WithName(GetText("response")).WithValue(cr.Response.TrimTo(1024)))).ConfigureAwait(false);
 | 
			
		||||
                    .AddField(GetText("trigger"), cr.Trigger.TrimTo(1024))
 | 
			
		||||
                    .AddField(GetText("response"), cr.Response.TrimTo(1024))).ConfigureAwait(false);
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
 
 | 
			
		||||
@@ -569,9 +569,7 @@ namespace NadekoBot.Modules.Gambling
 | 
			
		||||
                     var usrStr = x.ToString().TrimTo(20, true);
 | 
			
		||||
 | 
			
		||||
                     var j = i;
 | 
			
		||||
                     embed.AddField(efb => efb.WithName("#" + (9 * curPage + j + 1) + " " + usrStr)
 | 
			
		||||
                                              .WithValue(n(x.CurrencyAmount) + " " + CurrencySign)
 | 
			
		||||
                                              .WithIsInline(true));
 | 
			
		||||
                     embed.AddField("#" + (9 * curPage + j + 1) + " " + usrStr, n(x.CurrencyAmount) + " " + CurrencySign, true);
 | 
			
		||||
                 }
 | 
			
		||||
 | 
			
		||||
                 return embed;
 | 
			
		||||
 
 | 
			
		||||
@@ -87,8 +87,8 @@ namespace NadekoBot.Modules.Games.Common.Trivia
 | 
			
		||||
                {
 | 
			
		||||
                    questionEmbed = new EmbedBuilder().WithOkColor()
 | 
			
		||||
                        .WithTitle(GetText("trivia_game"))
 | 
			
		||||
                        .AddField(eab => eab.WithName(GetText("category")).WithValue(CurrentQuestion.Category))
 | 
			
		||||
                        .AddField(eab => eab.WithName(GetText("question")).WithValue(CurrentQuestion.Question));
 | 
			
		||||
                        .AddField(GetText("category"), CurrentQuestion.Category)
 | 
			
		||||
                        .AddField(GetText("question"), CurrentQuestion.Question);
 | 
			
		||||
 | 
			
		||||
                    if (showHowToQuit)
 | 
			
		||||
                        questionEmbed.WithFooter(GetText("trivia_quit", _quitCommand));
 | 
			
		||||
 
 | 
			
		||||
@@ -157,15 +157,11 @@ namespace NadekoBot.Modules.Games.Common
 | 
			
		||||
                        var wpm = CurrentSentence.Length / WORD_VALUE / elapsed.TotalSeconds * 60;
 | 
			
		||||
                        finishedUserIds.Add(msg.Author.Id);
 | 
			
		||||
                        await this.Channel.EmbedAsync(new EmbedBuilder().WithOkColor()
 | 
			
		||||
                                .WithTitle($"{msg.Author} finished the race!")
 | 
			
		||||
                                .AddField(efb =>
 | 
			
		||||
                                    efb.WithName("Place").WithValue($"#{finishedUserIds.Count}").WithIsInline(true))
 | 
			
		||||
                                .AddField(efb =>
 | 
			
		||||
                                    efb.WithName("WPM").WithValue($"{wpm:F1} *[{elapsed.TotalSeconds:F2}sec]*")
 | 
			
		||||
                                        .WithIsInline(true))
 | 
			
		||||
                                .AddField(efb =>
 | 
			
		||||
                                    efb.WithName("Errors").WithValue(distance.ToString()).WithIsInline(true)))
 | 
			
		||||
                            .ConfigureAwait(false);
 | 
			
		||||
                            .WithTitle($"{msg.Author} finished the race!")
 | 
			
		||||
                            .AddField("Place", $"#{finishedUserIds.Count}", true)
 | 
			
		||||
                            .AddField("WPM", $"{wpm:F1} *[{elapsed.TotalSeconds:F2}sec]*", true)
 | 
			
		||||
                            .AddField("Errors", distance.ToString(), true));
 | 
			
		||||
                        
 | 
			
		||||
                        if (finishedUserIds.Count % 4 == 0)
 | 
			
		||||
                        {
 | 
			
		||||
                            await this.Channel.SendConfirmAsync(
 | 
			
		||||
 
 | 
			
		||||
@@ -89,7 +89,7 @@ namespace NadekoBot.Modules.Games
 | 
			
		||||
                {
 | 
			
		||||
                    var loseEmbed = new EmbedBuilder().WithTitle($"Hangman Game ({game.TermType}) - Ended")
 | 
			
		||||
                                             .WithDescription(Format.Bold("You lose."))
 | 
			
		||||
                                             .AddField(efb => efb.WithName("It was").WithValue(game.Term.GetWord()))
 | 
			
		||||
                                             .AddField("It was", game.Term.GetWord())
 | 
			
		||||
                                             .WithFooter(string.Join(" ", game.PreviousGuesses))
 | 
			
		||||
                                             .WithErrorColor();
 | 
			
		||||
 | 
			
		||||
@@ -101,7 +101,7 @@ namespace NadekoBot.Modules.Games
 | 
			
		||||
 | 
			
		||||
                var winEmbed = new EmbedBuilder().WithTitle($"Hangman Game ({game.TermType}) - Ended")
 | 
			
		||||
                                             .WithDescription(Format.Bold($"{winner} Won."))
 | 
			
		||||
                                             .AddField(efb => efb.WithName("It was").WithValue(game.Term.GetWord()))
 | 
			
		||||
                                             .AddField("It was", game.Term.GetWord())
 | 
			
		||||
                                             .WithFooter(string.Join(" ", game.PreviousGuesses))
 | 
			
		||||
                                             .WithOkColor();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -64,23 +64,20 @@ namespace NadekoBot.Modules.Help.Services
 | 
			
		||||
            if (alias != null)
 | 
			
		||||
                str += $" **/ `{prefix + alias}`**";
 | 
			
		||||
            var em = new EmbedBuilder()
 | 
			
		||||
                .AddField(fb => fb.WithName(str)
 | 
			
		||||
                    .WithValue($"{com.RealSummary(_strings, guild?.Id, prefix)}")
 | 
			
		||||
                    .WithIsInline(true));
 | 
			
		||||
                .AddField(str, $"{com.RealSummary(_strings, guild?.Id, prefix)}", true);
 | 
			
		||||
 | 
			
		||||
            _dpos.TryGetOverrides(guild?.Id ?? 0, com.Name, out var overrides);
 | 
			
		||||
            var reqs = GetCommandRequirements(com, overrides);
 | 
			
		||||
            if(reqs.Any())
 | 
			
		||||
            {
 | 
			
		||||
                em.AddField(GetText("requires", guild),
 | 
			
		||||
                    string.Join("\n", reqs));
 | 
			
		||||
                em.AddField(GetText("requires", guild), string.Join("\n", reqs));
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            em
 | 
			
		||||
                .AddField(fb => fb.WithName(GetText("usage", guild))
 | 
			
		||||
                    .WithValue(string.Join("\n", Array.ConvertAll(com.RealRemarksArr(_strings, guild?.Id, prefix),
 | 
			
		||||
                        arg => Format.Code(arg))))
 | 
			
		||||
                    .WithIsInline(false))
 | 
			
		||||
                .AddField(GetText("usage", guild),
 | 
			
		||||
                    string.Join("\n", Array.ConvertAll(com.RealRemarksArr(_strings, guild?.Id, prefix),
 | 
			
		||||
                        arg => Format.Code(arg))),
 | 
			
		||||
                    false)
 | 
			
		||||
                .WithFooter(GetText("module", guild, com.Module.GetTopLevelModule().Name))
 | 
			
		||||
                .WithColor(Bot.OkColor);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -162,11 +162,11 @@ namespace NadekoBot.Modules.Music
 | 
			
		||||
                    await uow.SaveChangesAsync();
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                await ctx.Channel.EmbedAsync(new EmbedBuilder().WithOkColor()
 | 
			
		||||
                        .WithTitle(GetText("playlist_saved"))
 | 
			
		||||
                        .AddField(efb => efb.WithName(GetText("name")).WithValue(name))
 | 
			
		||||
                        .AddField(efb => efb.WithName(GetText("id")).WithValue(playlist.Id.ToString())))
 | 
			
		||||
                    .ConfigureAwait(false);
 | 
			
		||||
                await ctx.Channel.EmbedAsync(new EmbedBuilder()
 | 
			
		||||
                    .WithOkColor()
 | 
			
		||||
                    .WithTitle(GetText("playlist_saved"))
 | 
			
		||||
                    .AddField(GetText("name"), name)
 | 
			
		||||
                    .AddField(GetText("id"), playlist.Id.ToString()));
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -39,16 +39,14 @@ namespace NadekoBot.Modules.Permissions
 | 
			
		||||
                var embed = new EmbedBuilder().WithOkColor();
 | 
			
		||||
 | 
			
		||||
                if (blockedModule.Any())
 | 
			
		||||
                    embed.AddField(efb => efb
 | 
			
		||||
                        .WithName(GetText("blocked_modules"))
 | 
			
		||||
                        .WithValue(string.Join("\n", _service.BlockedModules))
 | 
			
		||||
                        .WithIsInline(false));
 | 
			
		||||
                    embed.AddField(GetText("blocked_modules")
 | 
			
		||||
                        , string.Join("\n", _service.BlockedModules)
 | 
			
		||||
                        , false);
 | 
			
		||||
 | 
			
		||||
                if (blockedCommands.Any())
 | 
			
		||||
                    embed.AddField(efb => efb
 | 
			
		||||
                        .WithName(GetText("blocked_commands"))
 | 
			
		||||
                        .WithValue(string.Join("\n", _service.BlockedCommands))
 | 
			
		||||
                        .WithIsInline(false));
 | 
			
		||||
                    embed.AddField(GetText("blocked_commands")
 | 
			
		||||
                        , string.Join("\n", _service.BlockedCommands)
 | 
			
		||||
                        , false);
 | 
			
		||||
 | 
			
		||||
                await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
@@ -67,9 +67,7 @@ namespace NadekoBot.Modules.Searches
 | 
			
		||||
                            .WithDescription(string.IsNullOrWhiteSpace(kvp.Value.Desc)
 | 
			
		||||
                                ? kvp.Value.ShortDesc
 | 
			
		||||
                                : kvp.Value.Desc)
 | 
			
		||||
                            .AddField(efb => efb.WithName(GetText("rating"))
 | 
			
		||||
                                                .WithValue(kvp.Value.Rating.ToString(_cultureInfo)).WithIsInline(true))
 | 
			
		||||
                            ).ConfigureAwait(false);
 | 
			
		||||
                            .AddField(GetText("rating"), kvp.Value.Rating.ToString(_cultureInfo), true));
 | 
			
		||||
                        return;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 
 | 
			
		||||
@@ -324,11 +324,8 @@ namespace NadekoBot.Modules.Searches
 | 
			
		||||
 | 
			
		||||
            await ctx.Channel.EmbedAsync(new EmbedBuilder()
 | 
			
		||||
                .WithColor(Bot.OkColor)
 | 
			
		||||
                .AddField(efb => efb.WithName(GetText("original_url"))
 | 
			
		||||
                                    .WithValue($"<{query}>"))
 | 
			
		||||
                .AddField(efb => efb.WithName(GetText("short_url"))
 | 
			
		||||
                                    .WithValue($"<{shortLink}>")))
 | 
			
		||||
                .ConfigureAwait(false);
 | 
			
		||||
                .AddField(GetText("original_url"), $"<{query}>")
 | 
			
		||||
                .AddField(GetText("short_url"), $"<{shortLink}>"));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        [NadekoCommand, Aliases]
 | 
			
		||||
@@ -540,7 +537,7 @@ namespace NadekoBot.Modules.Searches
 | 
			
		||||
                            .WithOkColor();
 | 
			
		||||
 | 
			
		||||
                        if (!string.IsNullOrWhiteSpace(data.Example))
 | 
			
		||||
                            embed.AddField(efb => efb.WithName(GetText("example")).WithValue(data.Example));
 | 
			
		||||
                            embed.AddField(GetText("example"), data.Example);
 | 
			
		||||
 | 
			
		||||
                        return embed;
 | 
			
		||||
                    }, col.Count, 1);
 | 
			
		||||
 
 | 
			
		||||
@@ -444,12 +444,8 @@ namespace NadekoBot.Modules.Searches.Services
 | 
			
		||||
                .WithTitle(status.Name)
 | 
			
		||||
                .WithUrl(status.StreamUrl)
 | 
			
		||||
                .WithDescription(status.StreamUrl)
 | 
			
		||||
                .AddField(efb => efb.WithName(GetText(guildId, "status"))
 | 
			
		||||
                    .WithValue(status.IsLive ? "🟢 Online" : "🔴 Offline")
 | 
			
		||||
                    .WithIsInline(true))
 | 
			
		||||
                .AddField(efb => efb.WithName(GetText(guildId, "viewers"))
 | 
			
		||||
                    .WithValue(status.IsLive ? status.Viewers.ToString() : "-")
 | 
			
		||||
                    .WithIsInline(true))
 | 
			
		||||
                .AddField(GetText(guildId, "status"), status.IsLive ? "🟢 Online" : "🔴 Offline", true)
 | 
			
		||||
                .AddField(GetText(guildId, "viewers"), status.IsLive ? status.Viewers.ToString() : "-", true)
 | 
			
		||||
                .WithColor(status.IsLive ? Bot.OkColor : Bot.ErrorColor);
 | 
			
		||||
 | 
			
		||||
            if (!string.IsNullOrWhiteSpace(status.Title))
 | 
			
		||||
 
 | 
			
		||||
@@ -63,13 +63,12 @@ namespace NadekoBot.Modules.Utility
 | 
			
		||||
                    embed.WithThumbnailUrl(guild.IconUrl);
 | 
			
		||||
                if (guild.Emotes.Any())
 | 
			
		||||
                {
 | 
			
		||||
                    embed.AddField(fb => 
 | 
			
		||||
                        fb.WithName(GetText("custom_emojis") + $"({guild.Emotes.Count})")
 | 
			
		||||
                        .WithValue(string.Join(" ", guild.Emotes
 | 
			
		||||
                    embed.AddField(GetText("custom_emojis") + $"({guild.Emotes.Count})",
 | 
			
		||||
                        string.Join(" ", guild.Emotes
 | 
			
		||||
                            .Shuffle()
 | 
			
		||||
                            .Take(20)
 | 
			
		||||
                            .Select(e => $"{e.Name} {e.ToString()}"))
 | 
			
		||||
                            .TrimTo(1020)));
 | 
			
		||||
                            .TrimTo(1020));
 | 
			
		||||
                }
 | 
			
		||||
                await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
@@ -38,12 +38,11 @@ namespace NadekoBot.Modules.Utility
 | 
			
		||||
                var helpcmd = Format.Code(Prefix + "donate");
 | 
			
		||||
                await ctx.Channel.EmbedAsync(new EmbedBuilder().WithOkColor()
 | 
			
		||||
                    .WithDescription(GetText("clpa_obsolete"))
 | 
			
		||||
                    .AddField(efb => efb.WithName(GetText("clpa_fail_already_title")).WithValue(GetText("clpa_fail_already")))
 | 
			
		||||
                    .AddField(efb => efb.WithName(GetText("clpa_fail_wait_title")).WithValue(GetText("clpa_fail_wait")))
 | 
			
		||||
                    .AddField(efb => efb.WithName(GetText("clpa_fail_conn_title")).WithValue(GetText("clpa_fail_conn")))
 | 
			
		||||
                    .AddField(efb => efb.WithName(GetText("clpa_fail_sup_title")).WithValue(GetText("clpa_fail_sup", helpcmd)))
 | 
			
		||||
                    .WithFooter(GetText("clpa_next_update", rem)))
 | 
			
		||||
                    .ConfigureAwait(false);
 | 
			
		||||
                    .AddField(GetText("clpa_fail_already_title"), GetText("clpa_fail_already"))
 | 
			
		||||
                    .AddField(GetText("clpa_fail_wait_title"), GetText("clpa_fail_wait"))
 | 
			
		||||
                    .AddField(GetText("clpa_fail_conn_title"), GetText("clpa_fail_conn"))
 | 
			
		||||
                    .AddField(GetText("clpa_fail_sup_title"), GetText("clpa_fail_sup", helpcmd))
 | 
			
		||||
                    .WithFooter(GetText("clpa_next_update", rem)));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -118,10 +118,10 @@ namespace NadekoBot.Modules.Utility
 | 
			
		||||
                await ctx.Channel.EmbedAsync(new EmbedBuilder()
 | 
			
		||||
                    .WithOkColor()
 | 
			
		||||
                    .WithTitle(GetText("quote_id", $"#{data.Id}"))
 | 
			
		||||
                    .AddField(efb => efb.WithName(GetText("trigger")).WithValue(data.Keyword))
 | 
			
		||||
                    .AddField(efb => efb.WithName(GetText("response")).WithValue(data.Text.Length > 1000
 | 
			
		||||
                    .AddField(GetText("trigger"), data.Keyword)
 | 
			
		||||
                    .AddField(GetText("response"), data.Text.Length > 1000
 | 
			
		||||
                        ? GetText("redacted_too_long")
 | 
			
		||||
                        : Format.Sanitize(data.Text)))
 | 
			
		||||
                        : Format.Sanitize(data.Text))
 | 
			
		||||
                    .WithFooter(GetText("created_by", $"{data.AuthorName} ({data.AuthorId})"))
 | 
			
		||||
                ).ConfigureAwait(false);
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
@@ -19,14 +19,19 @@ namespace NadekoBot.Modules.Utility
 | 
			
		||||
            public async Task ConvertList()
 | 
			
		||||
            {
 | 
			
		||||
                var units = _service.Units;
 | 
			
		||||
                var res = units.GroupBy(x => x.UnitType)
 | 
			
		||||
                               .Aggregate(new EmbedBuilder().WithTitle(GetText("convertlist"))
 | 
			
		||||
                                                            .WithOkColor(),
 | 
			
		||||
                                          (embed, g) => embed.AddField(efb =>
 | 
			
		||||
                                                                         efb.WithName(g.Key.ToTitleCase())
 | 
			
		||||
                                                                         .WithValue(String.Join(", ", g.Select(x => x.Triggers.FirstOrDefault())
 | 
			
		||||
                                                                                                       .OrderBy(x => x)))));
 | 
			
		||||
                await ctx.Channel.EmbedAsync(res).ConfigureAwait(false);
 | 
			
		||||
 | 
			
		||||
                var embed = new EmbedBuilder()
 | 
			
		||||
                    .WithTitle(GetText("convertlist"))
 | 
			
		||||
                    .WithOkColor();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                foreach (var g in units.GroupBy(x => x.UnitType))
 | 
			
		||||
                {
 | 
			
		||||
                    embed.AddField(g.Key.ToTitleCase(),
 | 
			
		||||
                        String.Join(", ", g.Select(x => x.Triggers.FirstOrDefault()).OrderBy(x => x)));
 | 
			
		||||
                }
 | 
			
		||||
                
 | 
			
		||||
                await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            [NadekoCommand, Aliases]
 | 
			
		||||
 
 | 
			
		||||
@@ -273,9 +273,9 @@ namespace NadekoBot.Modules.Utility
 | 
			
		||||
                        .AddField(GetText("memory"), $"{_stats.Heap} MB", true)
 | 
			
		||||
                        .AddField(GetText("owner_ids"), ownerIds, true)
 | 
			
		||||
                        .AddField(GetText("uptime"), _stats.GetUptimeString("\n"), true)
 | 
			
		||||
                        .AddField(efb => efb.WithName(GetText("presence")).WithValue(
 | 
			
		||||
                        .AddField(GetText("presence"), 
 | 
			
		||||
                            GetText("presence_txt",
 | 
			
		||||
                                _coord.GetGuildCount(), _stats.TextChannels, _stats.VoiceChannels)).WithIsInline(true)))
 | 
			
		||||
                                _coord.GetGuildCount(), _stats.TextChannels, _stats.VoiceChannels), true))
 | 
			
		||||
                .ConfigureAwait(false);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@@ -309,13 +309,13 @@ namespace NadekoBot.Modules.Utility
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            await ctx.Channel.EmbedAsync(guilds.Aggregate(new EmbedBuilder().WithOkColor(),
 | 
			
		||||
                                     (embed, g) => embed.AddField(efb => efb.WithName(g.Name)
 | 
			
		||||
                                                                           .WithValue(
 | 
			
		||||
                                             GetText("listservers", g.Id, g.MemberCount,
 | 
			
		||||
                                                 g.OwnerId))
 | 
			
		||||
                                                                           .WithIsInline(false))))
 | 
			
		||||
                         .ConfigureAwait(false);
 | 
			
		||||
            var embed = new EmbedBuilder().WithOkColor();
 | 
			
		||||
            foreach (var guild in guilds)
 | 
			
		||||
                embed.AddField(guild.Name,
 | 
			
		||||
                    GetText("listservers", guild.Id, guild.MemberCount, guild.OwnerId),
 | 
			
		||||
                    false);
 | 
			
		||||
 | 
			
		||||
            await ctx.Channel.EmbedAsync(embed);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user