From 4dc1b9f5a90efd97af2c4fff84f683503fa931fb Mon Sep 17 00:00:00 2001 From: Essem Date: Mon, 9 Aug 2021 11:12:47 -0500 Subject: [PATCH] Removed link from image title, handle undefined guilds --- commands/general/image.js | 2 +- events/messageCreate.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/commands/general/image.js b/commands/general/image.js index 852c30c..dc54b90 100644 --- a/commands/general/image.js +++ b/commands/general/image.js @@ -21,7 +21,7 @@ class ImageSearchCommand extends Command { "footer": { "text": `Page ${i + 1} of ${images.results.length}` }, - "description": `[${value.title}](${encodeURI(value.img_src)})`, + "description": value.title, "image": { "url": encodeURI(value.img_src) }, diff --git a/events/messageCreate.js b/events/messageCreate.js index dd1543f..5eec12c 100644 --- a/events/messageCreate.js +++ b/events/messageCreate.js @@ -22,7 +22,8 @@ module.exports = async (client, cluster, worker, ipc, message) => { } else { let guildDB = message.channel.guild ? await database.getGuild(message.channel.guild.id) : null; if (message.channel.guild && !(guildDB && guildDB.disabled)) { - guildDB = await database.fixGuild(message.channel.guild); + const fixedDB = await database.fixGuild(message.channel.guild); + guildDB = fixedDB ? fixedDB : guildDB; } prefixCandidate = guildDB.prefix; collections.prefixCache.set(message.channel.guild.id, guildDB.prefix);