-
-
Notifications
You must be signed in to change notification settings - Fork 219
Conversation
) | ||
if (data.description !== '') embed.setDescription(`/${data.description}/`) | ||
if (data.images) embed.setThumbnail(data.images[0]) | ||
if (data.stores) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (data.stores.length) {
'https://upcdatabase.org/images/logo.png' | ||
) | ||
if (data.description !== '') embed.setDescription(`/${data.description}/`) | ||
if (data.images) embed.setThumbnail(data.images[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (data.images.length) embed.setThumbnail(data.images[0])
t('commands:barcode.footer'), | ||
'https://upcdatabase.org/images/logo.png' | ||
) | ||
if (data.description !== '') embed.setDescription(`/${data.description}/`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the /
?
}, | ||
parameters: [{ | ||
type: 'string', | ||
full: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data.stores.map(d => | ||
({ | ||
name: d.store, | ||
price: `${d.price ? `$${d.price}` : ''}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value: `${d.price ? `$${d.price}` : ''}`
} catch (err) { | ||
channel.stopTyping() | ||
if (err.response && err.response.status === 404) { | ||
throw new CommandError(t('commands:barcode.notFound')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't throwing this when no information is found
data result:
Added code for fetching barcode information from the UPC database API about products with specified codes.
Closes #1182