Fixed some structure related things on ModArchive downloader

This commit is contained in:
Lucas Gabriel 2025-01-10 11:44:22 -03:00
parent ae8bea1001
commit cda8c0006e
No known key found for this signature in database
GPG Key ID: D9B075FC6DC93985

View File

@ -41,17 +41,15 @@ async function downloadModule(moduleId) {
module.exports = (bot) => { module.exports = (bot) => {
bot.command(['modarchive', 'tma'], spamwatchMiddleware, async (ctx) => { bot.command(['modarchive', 'tma'], spamwatchMiddleware, async (ctx) => {
const Strings = getStrings(ctx.from.language_code); 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, { return ctx.reply(Strings.maInvalidModule, {
parse_mode: "Markdown", parse_mode: "Markdown",
reply_to_message_id: ctx.message.message_id reply_to_message_id: ctx.message.message_id
}); });
} }
const moduleId = args[1];
const result = await downloadModule(moduleId); const result = await downloadModule(moduleId);
if (result) { if (result) {