mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-04-28 17:15:57 +00:00
Better error handling when sending a too large video
This commit is contained in:
parent
ac7d6f69d1
commit
ae8be193f5
@ -145,10 +145,27 @@ module.exports = (bot) => {
|
||||
|
||||
fs.unlinkSync(mp4File);
|
||||
} catch (error) {
|
||||
await ctx.reply(Strings.ytFileError, {
|
||||
if (error.includes("Request Entity Too Large")) {
|
||||
await ctx.telegram.editMessageText(
|
||||
ctx.chat.id,
|
||||
downloadingMessage.message_id,
|
||||
null,
|
||||
Strings.ytUploadLimit, {
|
||||
parse_mode: 'Markdown',
|
||||
reply_to_message_id: ctx.message.message_id,
|
||||
});
|
||||
},
|
||||
);
|
||||
} else {
|
||||
await ctx.telegram.editMessageText(
|
||||
ctx.chat.id,
|
||||
downloadingMessage.message_id,
|
||||
null,
|
||||
Strings.ytFileError, {
|
||||
parse_mode: 'Markdown',
|
||||
reply_to_message_id: ctx.message.message_id,
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
fs.unlinkSync(mp4File);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user