I have a bot which creates messages including some urls provided by users.
Telegram creates link previews for those urls. The previews are cached.
Sometimes the content of the url changes, then the preview provided by Telegram is outdated. So I need to update the link preview provided by Telegram.
Telegram link previews can be updated using https://telegram.me/webpagebot. But according to Telegram Bot API, a bot can't talk to another bot to avoid infinite loops. So opening a chat between my bot and webpagebot to request the update is not an option.
How could I force the update of a link preview from my bot? Is there some http request, API, or whatever to do it programmatically?
You may add a randomly generated variable to the end of the link, so Telegram looks a link as a new link, like this:
Suppose a old link is like:
https://example.com/offers/106-tatasky-recharge
If you change og_image, title, meta description of this page, then use the above link as:
https://example.com/offers/106-tatasky-recharge?t=18121980
I think, it solves the problem.
Related
I would like to know if via a Browser URL I can open the Telegram chat of a specific user and at the same time pre fill the first message with a text passt over the URL.
I know that I can open the chat of a user via this link format:
https://t.me/username
Now the only thing missing is how to pass a text message. For example like this:
https://t.me/username?text=example
It's not possible as of October 2022. You can only share a URL to a user and add a message there. The only thing I found. WhatsApp does it, Telegramm not. It would be a simple code in the Android app for instance, that would open the URL scheme, but it's not implemented
I am working on an telegram bot, and looking for the exact URL schema to popup the "Share / Select Group / Send to" dialogue in the telegram client.
I have seen this link in #pollbot, for which I took following screenshots.
A bit more details:
What I want is to give end-user an easy way to add the bot to their group, just like what PollBot does: When a poll being created, PollBot will return a special like to the user. Any by clicking that link, the user could easily add PollBot to a group. So I'm looking for the exact URL schema of that link.
I then check that link PollBot sent to me in telegram web client, and found out it's a tg protocol url: tg://resolve?domain=PollBot&startgroup=5148bed5f90678b93246464b3e132052. So I tried to resend this url via bot.sendMessage. But it turned out Telegram api server won't parse the tg://resolve url.
So, how could the bot manage to send such a link to the user?
The link there works with deeplinking, please read about it here:
https://core.telegram.org/bots#deep-linking
the url has the following scheme:
https://telegram.me/<YourBotUsername>?startgroup=<Payload>
the startgroup part (parameter) of the url tells telegram to open the 'add to group' dialog.
when you choose a group there (and you can add bot's to it) the bot will be added to the group and /start PAYLOAD will be send to that group.
The Payload is what you defined as value of the startgroup parameter, so your bot can assosiate it with something and send the matching reply.
please mind, that the Payload can only contain certain characters and don't mind that the telegram clients might internaly convert that link to an tg:// url.
you can also use start instead of startgroup to open a private chat.
According to Telegram docs:
Link Preview is generated server-side
I'm trying to make a bot to process the info in the link preview for links sent by users, but I couln't find a way to get that information from the Bot API.
Is there any way to ask the API for the information the link preview shows?
Although there is no API method to get this information, Telegram uses the Open Graph Protocol to generate its Link Previews.
Any open graph client will provide the same information that Telegram shows in their Link Previews.
Is there any way to ask the API for the information the link preview shows?
The answer would be no. The Bot API cannot process the information in the link preview.
I'm trying to make a bot to process the info in the link preview for links sent by users
However if you want the bot to know what is on the other side of the link, It is possible. You can use a HTML content scrapping library and a Summarizing library to get a link preview. I have attached below the libraries you can use and a Reddit bot which is somehow close to what you need. The example libraries are in python but you can essentially get or make for the language you use.
python-goose is a HTML content scrapping library
python summarizing library
another python summarizing library
sample reddit bot
Telegram MessageEntity object
I want to show my telegram channel contents in my wordpress website.
Is any way exist for stream telegram channel contents to my wordpress?
It is possible with Telegram Bot API. Basic idea:
Create a bot that can post to your channel;
Create an interaction layer between your site and the bot (for example, REST API);
Post something via your bot;
As soon as you post, your bot should send the post to both channel and website.
Also this can be done with the console client (channel_history command).
You can use this plugin : 'TelegramsChannelToWP'
first you must get API-key from :
http://en.tele-wall.ir/api/register/
then enter your site and your favorite channel
install plugin TelegramsChannelToWp
in setting page enter api-key and channel's username
add TelegramsChannelToWp widget.
Finish
https://github.com/mahdizolqadr/TelegramsChannelToWP
You can take a look at WP Telegram. It works very well from WP to telegram; moreover, it provides widget to show telegram channel or group on WP.
How can I send a message to the currently logged in user from inside a Flex application contained in a Facebook iFrame and using the official AS3 Library for Facebook please?
To date the Graph API is the easiest way to work with facebook.
http://code.google.com/p/fbas/
It's far from a complete implementation, but Graph is so simple it shouldn't take long to implement any features you need.
NOTE: When I've used it I ported the javascript portion of the example code on the project's main page to AS3 & ExternalInterface. It reduced external dependencies to zero (with the exception of swfobject)
Facebook does not allow you to send messages . Either way , you can post to the user's friends feed on behalf of the user , with a custom message and the the notification for the post in feed will be displayed.
Post your request to http://graph.facebook.com/PROFILE_ID/feed
Requires the publish_stream permission.
You can refer this link http://facebooksdk.blogspot.com/2011/04/facebook-album.html