From 4283a939b71f3664d4483155b0f0f4e4962ebe3f Mon Sep 17 00:00:00 2001 From: Toastie Date: Thu, 12 Dec 2024 19:40:14 +1300 Subject: [PATCH] .banner will now show a 'no banner' error, and will use image embed instead of thumbnail to show the banner. Only user server banners will be shown for now, global user banners will still not work. --- src/EllieBot/Modules/Searches/Searches.cs | 15 ++++++++++++--- .../data/strings/responses/responses.en-US.json | 3 ++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/EllieBot/Modules/Searches/Searches.cs b/src/EllieBot/Modules/Searches/Searches.cs index 00459ab..752af68 100644 --- a/src/EllieBot/Modules/Searches/Searches.cs +++ b/src/EllieBot/Modules/Searches/Searches.cs @@ -419,13 +419,22 @@ public partial class Searches : EllieModule var bannerUrl = usr.GetGuildBannerUrl(); + if (bannerUrl is null) + { + await Response() + .Error(strs.no_banner) + .SendAsync(); + + return; + } + await Response() .Embed( CreateEmbed() .WithOkColor() - .AddField("Username", usr.ToString()) - .AddField("Banner Url", bannerUrl) - .WithThumbnailUrl(bannerUrl)) + .AddField("Username", usr.ToString(), true) + .AddField("Banner Url", bannerUrl, true) + .WithImageUrl(bannerUrl)) .SendAsync(); } diff --git a/src/EllieBot/data/strings/responses/responses.en-US.json b/src/EllieBot/data/strings/responses/responses.en-US.json index fdb6dbb..b4eabb2 100644 --- a/src/EllieBot/data/strings/responses/responses.en-US.json +++ b/src/EllieBot/data/strings/responses/responses.en-US.json @@ -1158,5 +1158,6 @@ "notify_desc_addrolerew": "Triggers when a user gets a role as a reward for reaching a level (xprew).", "notify_desc_removerolerew": "Triggers when a user loses a role as a reward for reaching a level (xprew).", "notify_desc_not_found": "No description found for this notify event. Please report this.", - "winlb": "Biggest Wins Leaderboard" + "winlb": "Biggest Wins Leaderboard", + "no_banner": "No banner set." }