diff --git a/commands/help.js b/commands/help.js index 2055611..b5151cd 100644 --- a/commands/help.js +++ b/commands/help.js @@ -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; diff --git a/commands/youtube.js b/commands/youtube.js index 53fb7f2..0529181 100644 --- a/commands/youtube.js +++ b/commands/youtube.js @@ -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); diff --git a/locales/english.json b/locales/english.json index 48c7864..ab9e003 100644 --- a/locales/english.json +++ b/locales/english.json @@ -50,11 +50,13 @@ "mainCommands": "Main commands", "mainCommandsDesc": "*Main commands*\n\n- /help: Show bot's help\n- /start: Start the bot\n- /privacy: Read the bot's Privacy Policy", "usefulCommands": "Useful commands", - "usefulCommandsDesc": "*Useful commands*\n\n- /chatinfo: Send information about the group\n- /userinfo: Send information about yourself\n- /d | /device ``: Search for a device on GSMArena and show its specs.\n- /weather | /clima ``: See weather status for a specific location.\n- /modarchive | /tma ``: Download a module from The Mod Archive.\n- /yt `