- cataloghi...
- fix: condividi su Telegram non funzionava errore sull'immagine
This commit is contained in:
@@ -760,7 +760,7 @@ const MyTelegramBot = {
|
||||
if (cl && idtelegram) {
|
||||
|
||||
return await cl.sendMsg(idtelegram, text, null, MyForm, message_id,
|
||||
chat_id, ripr_menuPrec, img);
|
||||
chat_id, ripr_menuPrec, img, { idapp });
|
||||
}
|
||||
|
||||
return { text: '' };
|
||||
@@ -3883,7 +3883,10 @@ class Telegram {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
if (opt && opt.img) {
|
||||
opt.img = tools.fixUrl(opt.img, opt.idapp);
|
||||
console.log('opt.img', opt.img)
|
||||
return this.bot.sendPhoto(id, opt.img, { caption: text, ...form }).catch((e) => {
|
||||
let blocked = false;
|
||||
if ((e.message.indexOf('Forbidden') > 0) ||
|
||||
@@ -3942,7 +3945,7 @@ class Telegram {
|
||||
}
|
||||
}
|
||||
|
||||
async sendMsg(id, text, menu, form, msg_id, chat_id, ripr_menuPrec, img = '') {
|
||||
async sendMsg(id, text, menu, form, msg_id, chat_id, ripr_menuPrec, img = '', opzioni = null) {
|
||||
|
||||
if (!id || !text)
|
||||
return false;
|
||||
@@ -3952,12 +3955,12 @@ class Telegram {
|
||||
let text1 = text.slice(0, 4090);
|
||||
let text2 = text.slice(4090, text.length);
|
||||
await this._inviaMsg(id, text1, form, menu, msg_id, chat_id,
|
||||
ripr_menuPrec, { img });
|
||||
ripr_menuPrec, { img, ...opzioni });
|
||||
return await this._inviaMsg(id, text2, form, menu, msg_id, chat_id,
|
||||
ripr_menuPrec, { img });
|
||||
ripr_menuPrec, { img, ...opzioni });
|
||||
} else {
|
||||
return await this._inviaMsg(id, text, form, menu, msg_id, chat_id,
|
||||
ripr_menuPrec, { img });
|
||||
ripr_menuPrec, { img, ...opzioni });
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Error sendMsg', e);
|
||||
|
||||
Reference in New Issue
Block a user