fix embed

This commit is contained in:
derpystuff 2023-06-09 21:09:55 +02:00
parent 8b828473d8
commit c3f23c4d43

View file

@ -83,7 +83,7 @@ module.exports.createEmbed = function(type, context, content){
return emb
}
if(content.footer && !content.footer.iconUrl) content.footer.iconUrl = `https://cdn.discordapp.com/avatars/${context.application.id}/${context.application.icon}.png?size=256`
if(content && content.footer && !content.footer.iconUrl) content.footer.iconUrl = `https://cdn.discordapp.com/avatars/${context.application.id}/${context.application.icon}.png?size=256`
if(["image"].includes(type)){
if(content.url.includes('://')){
@ -97,7 +97,7 @@ module.exports.createEmbed = function(type, context, content){
if(content.provider.icon) emb.footer.iconUrl = content.provider.icon
}
if(content.time) emb.footer.text = `${emb.footer.text} • Took ${content.time}s`
if(content.time && emb.footer) emb.footer.text = `${emb.footer.text} • Took ${content.time}s`
return emb
}