通过电报机器人获取共享或点击链接的编号 [英] Get number of a link Shared or Clicked via telegram bot

查看:350
本文介绍了通过电报机器人获取共享或点击链接的编号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 node-telegram-bot-api 模块,我想获得我的用户分享给他们的朋友的链接的数量。

I'm using node-telegram-bot-api module and I want to get number of a link shared by my users to their Friends.

用户有一个共享状态按钮

有没有办法显示链接号共享点击由用户的朋友在分享状态按钮

Users have a Share Status Button
Is there a way to display number of a link Shared or Clicked by User's Friends in Share Status Button?

例如

1:约翰的分享状态按钮:5 //约翰共享5人或5人约翰的朋友点击该链接

2:Maria的分享状态按钮:20 // Maria与20个人或20个人的Maria的朋友共享点击该链接




有可能吗?

For example
1: John's Share Status Button : 5 // John Shared to 5 person or 5 person of John's Friends Clicked on that link
2: Maria's Share Status Button : 20 // Maria Shared to 20 person or 20 person of Maria's Friends Clicked on that link
.
. Is it possible?

更新:

bot.onText(/\/start/, (msg) => {
  const opts = {
    reply_markup: JSON.stringify({
      keyboard: StartKeyboard,
      resize_keyboard: true,
      one_time_keyboard: true
    })
  };
  bot.sendMessage(msg.chat.id, `telegram.me/fullmovie_bot?start=${msg.chat.id}`, opts);
  console.log (msg)
});


推荐答案

没有直接的,但你可以得到一些指标间接地。

There is no directly, but you can get few metrics indirectly.


  1. 发起的股票数量(1) - 使用内联按钮。返回URL时更新计数器。

  2. 已启动和已发送的份额数(2) - 使用 switch_inline_query + InlineQuery + answerInlineQuery + chosen_inline_result 记录attemts以分享&完成股份。内联查询的格式可以是 @yourbot invite?id = 1234 。此方法为您的渠道提供了更多指标,但对用户来说不太方便

  3. 要查看很多次邀请被查看 - 使用私人频道并在此处创建消息,转发与用户聊天,并要求转发为邀请。该消息将包含视图计数器。

  4. 跟踪已点击/已使用的共享使用回调按钮或跟踪点击的服务器代码的URL或 deeplinks 并检查 / start 参数。它可以是 / start invite?id = 123

  1. Number of shares initiated (1) - use inline button with a callback returning URL. When returning URL update the counter.
  2. Number of shares initiated + sent (2) - use switch_inline_query + InlineQuery + answerInlineQuery + chosen_inline_result to record attemts to share & completed shares. The inline query could be of form @yourbot invite?id=1234. This method give you more metrics to your funnel but is less convenient to users
  3. To see ho many times invite was viewed - Use a private channel and create message here, forward to chat with user and ask to forward as an invite. The message will have counter for views.
  4. To track shares clicked/used use either callback buttons or URL to server code that tracks clicks or deeplinks and check /start parameters. It can be of form /start invite?id=123

以上方法已成功用于我的机器人 @DebtsTrackerBot

Above approaches are successfully used in my bot @DebtsTrackerBot

这篇关于通过电报机器人获取共享或点击链接的编号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆