refactor: Downgrade to stable & use AddEmbed over WithEmbed
This commit is contained in:
parent
4705cb5f26
commit
2e73d66dc2
53 changed files with 190 additions and 179 deletions
|
|
@ -23,7 +23,7 @@ internal sealed class EvaluationCommand : BaseCommand
|
|||
{
|
||||
if (ctx.CommandType is not Enums.CommandType.ApplicationCommand and not Enums.CommandType.ContextMenu)
|
||||
{
|
||||
_ = await this.RespondOrEdit(new DiscordMessageBuilder().WithEmbed(new DiscordEmbedBuilder().WithDescription("Evaluating CScript has the potential of leaking confidential information. Are you sure you want to run this command as Prefix Command?").AsWarning(ctx))
|
||||
_ = await this.RespondOrEdit(new DiscordMessageBuilder().AddEmbed(new DiscordEmbedBuilder().WithDescription("Evaluating CScript has the potential of leaking confidential information. Are you sure you want to run this command as Prefix Command?").AsWarning(ctx))
|
||||
.AddComponents(new List<DiscordComponent> { new DiscordButtonComponent(ButtonStyle.Success, "yes", "Yes"),
|
||||
new DiscordButtonComponent(ButtonStyle.Danger, "no", "No")}));
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ internal sealed class GlobalNotesCommand : BaseCommand
|
|||
var RemoveButton = new DiscordButtonComponent(ButtonStyle.Primary, Guid.NewGuid().ToString(), "Remove Notes", (!ctx.Bot.globalNotes.ContainsKey(victim.Id)), DiscordEmoji.FromUnicode("➖").ToComponent());
|
||||
|
||||
_ = await this.RespondOrEdit(new DiscordMessageBuilder()
|
||||
.WithEmbed(new DiscordEmbedBuilder()
|
||||
.AddEmbed(new DiscordEmbedBuilder()
|
||||
.WithDescription($"{victim.Mention} `has {(ctx.Bot.globalNotes.TryGetValue(victim.Id, out var noteObj) ? noteObj.Notes.Length : 0)} global notes.`")
|
||||
.AddFields((noteObj is not null ? noteObj.Notes.Take(20).Select(x => new DiscordEmbedField(" ", $"{x.Reason.FullSanitize()} - `{(ModeratorCache[x.Moderator] is null ? "Unknown#0000" : ModeratorCache[x.Moderator].GetUsernameWithIdentifier())}` {x.Timestamp.ToTimestamp()}")) : new List<DiscordEmbedField>())))
|
||||
.AddComponents(new List<DiscordComponent> { AddButton, RemoveButton })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue