@ChanMBot 5.2

Here I am with another update!

In this update we will add a way to get the id of other users

if you check the events section on the telebot github repository you can see forward

so we do it like this:

bot.on(['forward'], (msg) => {
  let id = msg.chat.id;
  let replyToMessage = msg.message_id;
  let parseMode = 'markdown';
  let ff = msg.forward_from;

  return bot.sendMessage(id, `From First Name: \`${ff.first_name}\`
From Last Name: \`${ff.last_name}\`
From Username: \`${ff.username}\`
From ID: \`${ff.id}\``, {parseMode, replyToMessage});
  }
});

and every time you forward a message from any user it will return a message with the first name, last name, username and id!

Leave a Reply

Your email address will not be published. Required fields are marked *