mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 12:49:57 +00:00
Fixed some structure related things on ModArchive downloader
This commit is contained in:
parent
ae8bea1001
commit
cda8c0006e
@ -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…
x
Reference in New Issue
Block a user