From cda8c0006e5af60a736c666b66249da601001679 Mon Sep 17 00:00:00 2001 From: Luquinhas Date: Fri, 10 Jan 2025 11:44:22 -0300 Subject: [PATCH] Fixed some structure related things on ModArchive downloader --- src/commands/modarchive.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/commands/modarchive.js b/src/commands/modarchive.js index 9e17582..3a10244 100644 --- a/src/commands/modarchive.js +++ b/src/commands/modarchive.js @@ -41,17 +41,15 @@ async function downloadModule(moduleId) { module.exports = (bot) => { bot.command(['modarchive', 'tma'], spamwatchMiddleware, async (ctx) => { const Strings = getStrings(ctx.from.language_code); - const args = ctx.message.text.split(' '); + const moduleId = ctx.message.text.split(' ')[1]; - if (args.length !== 2) { + if (moduleId == NaN || null) { return ctx.reply(Strings.maInvalidModule, { parse_mode: "Markdown", reply_to_message_id: ctx.message.message_id }); } - const moduleId = args[1]; - const result = await downloadModule(moduleId); if (result) {