From bce182d63d9623c8c57854f576d889c47fdbc263 Mon Sep 17 00:00:00 2001 From: GiovaniFZ Date: Thu, 12 Sep 2024 22:23:22 -0300 Subject: [PATCH] feat: Send any file to admins with getFile command --- commands/crew.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/commands/crew.js b/commands/crew.js index d9c48c0..3727f3f 100644 --- a/commands/crew.js +++ b/commands/crew.js @@ -90,7 +90,7 @@ module.exports = (bot) => { } }, '', Strings.errorRetrievingCommit); }); - + bot.command('setbotname', spamwatchMiddleware, async (ctx) => { const Strings = getStrings(ctx.from.language_code); const botName = ctx.message.text.split(' ').slice(1).join(' '); @@ -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'); + } + }); + }); };