From a066ab27c135914a45cd902a5feb1116e456b3a0 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Tue, 31 Aug 2021 09:49:21 -0600 Subject: [PATCH] utility.banner: guild error handling --- src/modules/utility.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/utility.js b/src/modules/utility.js index a446376..c4270a0 100644 --- a/src/modules/utility.js +++ b/src/modules/utility.js @@ -175,6 +175,9 @@ banner.callback = async function (msg, line) { return "`--server/--guild` can only be used within guilds."; } else { const guild = msg.channel.guild || hf.bot.guilds.get(msg.guildID); + + if (!guild.banner) return "This guild does not have a banner."; + const url = `${BANNER_BASE}${guild.id}/${guild.banner}.${ guild.banner.startsWith("a_") ? "gif?size=1024&_=.gif" : "png?size=1024" }`;