Laravel Check the User Share Telegram Bot Link to other Users

天涯浪子 提交于 2019-12-11 08:52:41

问题


Hi i want to develop the bot , but first i ask users to share the link of my bot to 5 other users then continue and register in my bot , i develop all sections but i cannot handle the first one, how can i detect that the use send share link to other user ? i user laravel + talageram bot SDK to develop my bot.

i just want to know that user share the link and continue , i search in many docs and site bud i cannot find anythings that useful to me. please help me to handle this problem in my telegram bot . thanks :)


回答1:


Basically, you can't find out if your user has sent the link to others. You can only find out when the other user taps on the link and starts your bot. This can be done by Deep Linking. You should create a unique identifier for each user and add it as a query string to the special link made for the user.

Example:

https://telegram.me/my_bot?invitedFrom=user1

You have to check for invitedFrom parameter each time a user starts your bot in order to credit the referrer user.

By using above method, you will only be notified when the other user starts your bot.


However there is a trick you can do in order to see if a special message is forwarded to other users. Here are the steps:

  1. Make a private channel.
  2. Create a message containing your bot link.
  3. Forward the message to your bot user.
  4. Ask your bot user to forward the message to friends.
  5. Check the view count of the message to know if it's seen by others.

By using this trick you can find out how many times the message containing your bot link is seen.



来源:https://stackoverflow.com/questions/46316848/laravel-check-the-user-share-telegram-bot-link-to-other-users

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!