Skip to content

Commit

Permalink
updated simple reply
Browse files Browse the repository at this point in the history
  • Loading branch information
gnehs committed Jul 21, 2023
1 parent 016e515 commit b782f72
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/simple-reply.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit b782f72

Please sign in to comment.