Include yt-dlp on help

This commit is contained in:
Lucas Gabriel 2024-09-28 23:14:27 -03:00
parent 3aa22a6b90
commit 2067e21a34
No known key found for this signature in database
GPG key ID: D9B075FC6DC93985
4 changed files with 15 additions and 5 deletions

View file

@ -10,7 +10,7 @@ async function sendHelpMessage(ctx, isEditing) {
inline_keyboard: [
[{ text: Strings.mainCommands, callback_data: '1' }, { text: Strings.usefulCommands, callback_data: '2' }],
[{ text: Strings.interactiveEmojis, callback_data: '3' }, { text: Strings.funnyCommands, callback_data: '4' }],
[{ text: Strings.lastFm, callback_data: '5' }]
[{ text: Strings.lastFm, callback_data: '5' }, { text: Strings.ytDlp, callback_data: '6' }]
]
}
};
@ -35,7 +35,7 @@ module.exports = (bot) => {
disable_web_page_preview: true,
reply_markup: JSON.stringify({
inline_keyboard: [
[{ text: Strings.goBack, callback_data: '6' }],
[{ text: Strings.goBack, callback_data: '7' }],
]
})
};
@ -62,6 +62,10 @@ module.exports = (bot) => {
await ctx.editMessageText(Strings.lastFmDesc, options);
break;
case '6':
await ctx.answerCbQuery();
await ctx.editMessageText(Strings.ytDlpDesc, options);
break;
case '7':
await ctx.answerCbQuery();
await sendHelpMessage(ctx, true);
break;

View file

@ -115,6 +115,8 @@ module.exports = (bot) => {
parse_mode: 'Markdown',
reply_to_message_id: ctx.message.message_id,
});
fs.unlinkSync(mp4File);
}
}
} catch (error) {
@ -126,7 +128,7 @@ module.exports = (bot) => {
} else {
errStatus = error.error ? error.error.message : 'Unknown error';
}
const message = strings.ytDownloadErr
.replace("{err}", errStatus)
.replace("{userName}", ctx.from.first_name);