mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 12:49:57 +00:00
feat: Send any file to admins with getFile command
This commit is contained in:
parent
4b583ecc0c
commit
bce182d63d
@ -90,7 +90,7 @@ module.exports = (bot) => {
|
|||||||
}
|
}
|
||||||
}, '', Strings.errorRetrievingCommit);
|
}, '', Strings.errorRetrievingCommit);
|
||||||
});
|
});
|
||||||
|
|
||||||
bot.command('setbotname', spamwatchMiddleware, async (ctx) => {
|
bot.command('setbotname', spamwatchMiddleware, async (ctx) => {
|
||||||
const Strings = getStrings(ctx.from.language_code);
|
const Strings = getStrings(ctx.from.language_code);
|
||||||
const botName = ctx.message.text.split(' ').slice(1).join(' ');
|
const botName = ctx.message.text.split(' ').slice(1).join(' ');
|
||||||
@ -117,4 +117,15 @@ module.exports = (bot) => {
|
|||||||
await ctx.telegram.leaveChat(ctx.chat.id);
|
await ctx.telegram.leaveChat(ctx.chat.id);
|
||||||
}, '', Strings.kickingMyselfErr);
|
}, '', Strings.kickingMyselfErr);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
bot.command('getfile', spamwatchMiddleware, async (ctx) => {
|
||||||
|
const botFile = ctx.message.text.split(' ').slice(1).join(' ');
|
||||||
|
handleAdminCommand(ctx, async () => {
|
||||||
|
try{
|
||||||
|
await ctx.replyWithDocument({source: botFile});
|
||||||
|
}catch (error){
|
||||||
|
console.log('ERROR');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user