From b782f725cdb5e73579c75821c1d50fcde9b3b7e1 Mon Sep 17 00:00:00 2001 From: gnehs Date: Fri, 21 Jul 2023 08:49:52 +0800 Subject: [PATCH] updated simple reply --- components/simple-reply.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/simple-reply.js b/components/simple-reply.js index 5168d5d..e7b63c1 100644 --- a/components/simple-reply.js +++ b/components/simple-reply.js @@ -80,4 +80,12 @@ bot.hears("晚安", ({ reply, message, replyWithSticker }) => { } }); +// get user info by id +bot.command("getuserinfo", async ({ reply, message }) => { + let splitedCommand = message.text.split(" "); + splitedCommand.shift(); // remove first element + let id = splitedCommand.join(" "); + let user = await telegram.getChat(id); + reply(JSON.stringify(user), { reply_to_message_id: message.message_id }); +}); module.exports = bot;