mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 13:43:06 -04:00
fix error if labels are unavailable (for whatever reason)
This commit is contained in:
parent
8657b8c93b
commit
91c7a6850c
1 changed files with 25 additions and 17 deletions
|
@ -20,6 +20,7 @@ module.exports = {
|
|||
run: async (context) => {
|
||||
await acknowledge(context);
|
||||
|
||||
try{
|
||||
let image = await getRecentImage(context, 50)
|
||||
if (!image) return editOrReply(context, createEmbed("warning", context, "No images found."))
|
||||
|
||||
|
@ -39,5 +40,12 @@ module.exports = {
|
|||
text: `Google Lens • ${context.application.name}`
|
||||
}
|
||||
}))
|
||||
}catch(e){
|
||||
console.error(e);
|
||||
if(e.response?.body?.message)
|
||||
return editOrReply(context, createEmbed(e.response.body.status === 1 ? "warning": "error", context, e.response.body.message))
|
||||
|
||||
return editOrReply(context, createEmbed("error", context, "Unable to get labels for this image."))
|
||||
}
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue