feat: Send any file to admins with getFile command

This commit is contained in:
GiovaniFZ 2024-09-12 22:23:22 -03:00
parent 4b583ecc0c
commit bce182d63d
No known key found for this signature in database
GPG Key ID: 63DD92181B575322

View File

@ -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');
}
});
});
};