From aaef7b4a567079ad8e2d0e74f862ad541a07ed49 Mon Sep 17 00:00:00 2001 From: Joshi234 <46032261+Joshi234@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:18:54 +0200 Subject: [PATCH 1/2] Change Paginated Appearance Options to allow the use of an help embed --- .../Interactions/PaginationInteractions.cs | 8 +------- Remora.Discord.Pagination/PaginatedAppearanceOptions.cs | 9 +++++++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Remora.Discord.Pagination/Interactions/PaginationInteractions.cs b/Remora.Discord.Pagination/Interactions/PaginationInteractions.cs index 966c5c030c..431be8bec6 100644 --- a/Remora.Discord.Pagination/Interactions/PaginationInteractions.cs +++ b/Remora.Discord.Pagination/Interactions/PaginationInteractions.cs @@ -176,13 +176,7 @@ public async Task HelpAsync() return Result.FromSuccess(); } - return (Result)await _feedback.SendContextualInfoAsync - ( - lease.Data.Appearance.HelpText, - lease.Data.SourceUserID, - new FeedbackMessageOptions(MessageFlags: MessageFlags.Ephemeral), - this.CancellationToken - ); + return (Result)await _feedback.SendContextualEmbedAsync(lease.Data.Appearance.HelpEmbed, ct: this.CancellationToken); } private async Task UpdateAsync(Action action, CancellationToken ct) diff --git a/Remora.Discord.Pagination/PaginatedAppearanceOptions.cs b/Remora.Discord.Pagination/PaginatedAppearanceOptions.cs index 528d157045..69141e218c 100644 --- a/Remora.Discord.Pagination/PaginatedAppearanceOptions.cs +++ b/Remora.Discord.Pagination/PaginatedAppearanceOptions.cs @@ -39,8 +39,8 @@ public sealed record PaginatedAppearanceOptions ButtonComponent Last, ButtonComponent Close, ButtonComponent Help, - string FooterFormat = "Page {0}/{1}", - string HelpText = "This is a paginated message. Use the buttons to change page." + Embed HelpEmbed, + string FooterFormat = "Page {0}/{1}" ) { /// @@ -83,6 +83,11 @@ public sealed record PaginatedAppearanceOptions ButtonComponentStyle.Secondary, Emoji: new PartialEmoji(Name: "ℹ"), Label: nameof(Help) + ), + new Embed + ( + Title: "Pagination Help", + Description: "Use the buttons below to navigate the pages." ) ); From 0ff5e6b5ea5bd85e3801896c2d2203d47c22dd1a Mon Sep 17 00:00:00 2001 From: Joshi234 <46032261+Joshi234@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:31:45 +0200 Subject: [PATCH 2/2] Change Embed to be Ephemeral --- .../Interactions/PaginationInteractions.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Remora.Discord.Pagination/Interactions/PaginationInteractions.cs b/Remora.Discord.Pagination/Interactions/PaginationInteractions.cs index 431be8bec6..40f27e5e02 100644 --- a/Remora.Discord.Pagination/Interactions/PaginationInteractions.cs +++ b/Remora.Discord.Pagination/Interactions/PaginationInteractions.cs @@ -175,8 +175,12 @@ public async Task HelpAsync() { return Result.FromSuccess(); } - - return (Result)await _feedback.SendContextualEmbedAsync(lease.Data.Appearance.HelpEmbed, ct: this.CancellationToken); + return (Result)await _feedback.SendContextualEmbedAsync + ( + lease.Data.Appearance.HelpEmbed, + new FeedbackMessageOptions(MessageFlags: MessageFlags.Ephemeral), + ct: this.CancellationToken + ); } private async Task UpdateAsync(Action action, CancellationToken ct)