Fixed some structure related things on ModArchive downloader
This commit is contained in:
parent
ae8bea1001
commit
cda8c0006e
1 changed files with 2 additions and 4 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue