node.jsbotstelegramtelegrafmention

Telegraf.js bot create a user link without mentioning a user


I am trying to send message via bot that contains a link to user profile, but problem is, that this mesage makes an annoying notification for user, with an '@' icon in chat group, is there a way to avoid that?

        const msg = data?.sort((a, b) => b.rating - a.rating)
      .reduce((acc, item, index) => {
        if (index > 14) return acc;

        acc += `🌟 <a href="tg://user?id=${item.user_id}"><b>${item.user_name}</b></a> - ${item.rating}\n`;
  
        return acc;
      }, '');
    ctx.replyWithHTML(`Top 15 gamers:
${msg}`, { disable_notification: true }).catch((err) => console.error(err));

that icon


Solution

  • "✅  <b><a href='https://t.me/user?id={$id}'>{$name}</a></b>"
    

    figured it out 1 year later