error handling for emojimix

This commit is contained in:
derpystuff 2023-06-11 01:05:16 +02:00
parent 2d57a75e9b
commit 7573b38c97

View file

@ -92,19 +92,23 @@ module.exports = {
// Emoji Mixing // Emoji Mixing
if(emoji.length >= 2){ if(emoji.length >= 2){
let em = await emojiKitchen(emoji) try{
if(!em.body.results[0]){ let em = await emojiKitchen(emoji)
for(const em of emoji){ if(!em.body.results[0]){
try{ for(const em of emoji){
await emojiKitchen([em]) try{
}catch(e){ await emojiKitchen([em])
return editOrReply(context, createEmbed("warning", context, `Unsupported Emoji (${em})`)) }catch(e){
return editOrReply(context, createEmbed("warning", context, `Unsupported Emoji (${em})`))
}
} }
return editOrReply(context, createEmbed("error", context, "Combination not supported."))
} }
return editOrReply(context, createEmbed("image", context, { url: em.body.results[0].url }))
return editOrReply(context, createEmbed("error", context, "Combination not supported.")) }catch(e){
return editOrReply(context, createEmbed("error", context, "Unable to mix emoji."))
} }
return editOrReply(context, createEmbed("image", context, { url: em.body.results[0].url }))
} }
// Regular Emoji Handling // Regular Emoji Handling