From 23c68d1d44e0565710596ab920e7569c4a970b74 Mon Sep 17 00:00:00 2001 From: Nils <7890309+DarkView@users.noreply.github.com> Date: Sat, 13 Feb 2021 19:04:59 +0100 Subject: [PATCH] Add image links to server info embed (#150) --- .../Utility/functions/getServerInfoEmbed.ts | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/backend/src/plugins/Utility/functions/getServerInfoEmbed.ts b/backend/src/plugins/Utility/functions/getServerInfoEmbed.ts index 4486d5f5..3022a250 100644 --- a/backend/src/plugins/Utility/functions/getServerInfoEmbed.ts +++ b/backend/src/plugins/Utility/functions/getServerInfoEmbed.ts @@ -80,6 +80,32 @@ export async function getServerInfoEmbed( value: basicInformation.join("\n"), }); + // IMAGE LINKS + const iconUrl = `[URL](${(restGuild || guildPreview)!.iconURL})`; + const bannerUrl = restGuild?.bannerURL ?? "Unavailable"; + const splashUrl = + (restGuild || guildPreview)!.splashURL != null + ? `[URL](${(restGuild || guildPreview)!.splashURL?.replace("size=128", "size=2048")})` + : "None"; + + embed.fields.push( + { + name: "Server icon", + value: iconUrl, + inline: true, + }, + { + name: "Invite splash", + value: splashUrl, + inline: true, + }, + { + name: "Server banner", + value: bannerUrl, + inline: true, + }, + ); + // MEMBER COUNTS const totalMembers = guildPreview?.approximateMemberCount ||