product photo fix
This commit is contained in:
parent
de5e405093
commit
df3149e59a
BIN
corrupt-photo.jpg
Normal file
BIN
corrupt-photo.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.1 KiB |
@ -564,17 +564,22 @@ Coordinates: ${product.hidden_coordinates}
|
|||||||
|
|
||||||
// Send product photos
|
// Send product photos
|
||||||
if (product.photo_url) {
|
if (product.photo_url) {
|
||||||
|
try {
|
||||||
await this.bot.sendPhoto(chatId, product.photo_url, { caption: 'Public photo' });
|
await this.bot.sendPhoto(chatId, product.photo_url, { caption: 'Public photo' });
|
||||||
|
} catch (e) {
|
||||||
|
await this.bot.sendPhoto(chatId, "./corrupt-photo.jpg", { caption: 'Public photo' })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (product.hidden_photo_url) {
|
if (product.hidden_photo_url) {
|
||||||
|
try {
|
||||||
await this.bot.sendPhoto(chatId, product.hidden_photo_url, { caption: 'Hidden photo' });
|
await this.bot.sendPhoto(chatId, product.hidden_photo_url, { caption: 'Hidden photo' });
|
||||||
|
} catch (e) {
|
||||||
|
await this.bot.sendPhoto(chatId, "./corrupt-photo.jpg", { caption: 'Hidden photo' })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.bot.editMessageText(message, {
|
await this.bot.deleteMessage(chatId, messageId);
|
||||||
chat_id: chatId,
|
await this.bot.sendMessage(chatId, message, { reply_markup: keyboard });
|
||||||
message_id: messageId,
|
|
||||||
reply_markup: keyboard
|
|
||||||
});
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error in handleViewProduct:', error);
|
console.error('Error in handleViewProduct:', error);
|
||||||
await this.bot.sendMessage(chatId, 'Error loading product details. Please try again.');
|
await this.bot.sendMessage(chatId, 'Error loading product details. Please try again.');
|
||||||
|
Loading…
Reference in New Issue
Block a user