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
@ -117,4 +117,15 @@ module.exports = (bot) => {
|
||||
await ctx.telegram.leaveChat(ctx.chat.id);
|
||||
}, '', 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