A telegram bot for get specific data - text-mining

I want to create a bot telegram to retrieve some information from another robot or channel
I just wanted a training resource for this

create a userbot wit telethon: https://github.com/LonamiWebs/Telethon/commits?author=Lonami

Related

Telegram bot analytics

I have checked telegram bot api web but could not find analytics api for bot, is telegram provide
analytics api for bots, if yes any one have reference it will helps me a lot
the Telegram API does not provide you with a way to get analytics. It is only an interface to operate the bot automatically.
However, there are services like this:
https://www.integromat.com/en/integrations/google-analytics/telegram
You can check it out and see if it fits your needs.
Whenever you build a database you can create metrics and analytics.
To analyze statistics, Telegram Robot, you must save anyone who starts the robot in the database(json data base or mysql or etc). To do this, you can get the user id (it is easy to get the user id)

Is there any way to transfer Telegram file IDs between different bots?

Many different media types on Telegram have a file_id and file_unique_id property, such as Stickers, Audio, and Document.
The file_id property is unique to each Telegram bot, so one Telegram bot will not report the same file_id as another Telegram bot will, even if it's the same piece of media.
I want to have two Telegram bots communicate with each other, but they are currently unable to do so because the file_id property is meaningless when one bot tries to talk to the other.
The file_unique_id property is consistent between the bots, but it does not seem like you can do much of anything with that identifier.
Is there any way to pass a reference to a file stored on Telegram's servers from one bot to another, without having to re-upload the file on both bots?
Bot can't interact with each other. But there's a workaround,
we can use channels as a medium (with only BotAPI)
Steps,
Add two bots as admin in channel
Broadcast the messages from Bot A to channel
Now, the Bot B will get these as channel posts and your new fileid
for the same file which will be unique for Bot B (obviously)
You have officially transferred all fileid to Bot B
There aren't any official methods to share fileIds between bots. In fact, you can't even get 2 bots talk to each other, also you won't get bot updates in groups. So bot to bot communication is not possible at all at this moment.
But what you can do is to use Mtproto api and sign-in to telegram as a normal user (with phone number). And follow these steps using the logged in account:
Start both of your bots.
Forward messages you receive from bot 1 to bot 2.
This way you'll be able to access any files in bot 1 in bot 2.
You can use Telethon to write a script that does the job for you, listening to updates coming from bot 1 & forwarding them to bot 2.
Also using normal bot api you should forward received messages to your logged-in account.
The only way is to use a shared channel. Both bots have admin access. However, you may encounter error 429 while transferring the file.
The solution is to send the files to the channel at longer intervals.

How to get specific channel chat history using telegram bot api?

I am using telegram bot api to get the chat history of a channel https://api.telegram.org/botXXXXXXXXXXXXXXXXXX/getupdates
my bot attached to the many channels and my query is that how to get chat history of any specific channel which is using my bot.
but when I am using getupdates method it shows all the message with all channel.
my query is how to get the solution using telegram bot API?
just like when we need to send a message to any specific channel using the used the https://api.telegram.org/botxxxxxxxxxxxx/sendMessage?chat_id=#channel id&text=message
i need a solution where I can send channel id and get the specific channel chat history using telegram bot API
my bot attached to the many channels and my query is that how to get
chat history of any specific channel which is using my bot
You cannot get the chat history of a channel using the bot API. However you can use the core API (tdlib e.t.c) to get the chat history. Alternatively you can try and scrape from the posts widget, but that is going to be too tedious.
but when I am using getupdates method it shows all the message with all channel.
You can manually filter out the channels since the ID is always in the Update object. I would suggest you use a library for this since it would be easier to implement the logic.

How to get member list with telegram bot?

I create a telegram bot. How to get member list with telegram bot?
What url should I use to get information about all members in channel?
Unfortunately this isn't possible at this time. In order to get user list, you need to use telegram API.

Bot sending an interactive google map to Telegram user

A bot wants to send a map with specific lat/lng point to a Telegram user. When clicked that map should lead user to an interactive map version.
I saw one bot (SberbankBot) can do that, but I need to know how exactly.
I'm using Python 2.7 + telepot library.
As #mymedia pointed out in comments, you can use sendLocation method of Telegram Bot APi, and using telepot:
bot.sendLocation(chat_id, latitude=lat, longitude=lon);