Removed link from image title, handle undefined guilds
This commit is contained in:
parent
3ce2352d1c
commit
4dc1b9f5a9
2 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||||
},
|
},
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue