Skip to content

Commit

Permalink
fix: remove try catch in _fixAddFileThumb
Browse files Browse the repository at this point in the history
  • Loading branch information
danielperez9430 committed Dec 31, 2022
1 parent 58261d1 commit 53b5565
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/telegram.js
Expand Up @@ -243,16 +243,12 @@ class TelegramBot extends EventEmitter {
opts.formData = {};
}

try {
const attachName = 'photo';
const [formData] = this._formatSendData(attachName, options.thumb.replace('attach://', ''));
const attachName = 'photo';
const [formData] = this._formatSendData(attachName, options.thumb.replace('attach://', ''));

if (formData) {
opts.formData[attachName] = formData[attachName];
opts.qs.thumb = `attach://${attachName}`;
}
} catch (ex) {
throw Promise.reject(ex);
if (formData) {
opts.formData[attachName] = formData[attachName];
opts.qs.thumb = `attach://${attachName}`;
}
}
}
Expand Down

0 comments on commit 53b5565

Please sign in to comment.