Removed link from image title, handle undefined guilds

This commit is contained in:
Essem 2021-08-09 11:12:47 -05:00
parent 3ce2352d1c
commit 4dc1b9f5a9
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
2 changed files with 3 additions and 2 deletions

View file

@ -21,7 +21,7 @@ class ImageSearchCommand extends Command {
"footer": { "footer": {
"text": `Page ${i + 1} of ${images.results.length}` "text": `Page ${i + 1} of ${images.results.length}`
}, },
"description": `[${value.title}](${encodeURI(value.img_src)})`, "description": value.title,
"image": { "image": {
"url": encodeURI(value.img_src) "url": encodeURI(value.img_src)
}, },

View file

@ -22,7 +22,8 @@ module.exports = async (client, cluster, worker, ipc, message) => {
} else { } else {
let guildDB = message.channel.guild ? await database.getGuild(message.channel.guild.id) : null; let guildDB = message.channel.guild ? await database.getGuild(message.channel.guild.id) : null;
if (message.channel.guild && !(guildDB && guildDB.disabled)) { 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; prefixCandidate = guildDB.prefix;
collections.prefixCache.set(message.channel.guild.id, guildDB.prefix); collections.prefixCache.set(message.channel.guild.id, guildDB.prefix);