How to get specific channel chat history using telegram bot api? - 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.

Related

How to implement Telegram bot as a widget on your website?

I'm trying to create some sort of live chat widget, but with a Telegram bot instead of a real person on the other side. I don't know if it is possible, but ideally, there is a chat window that can be implemented on a website, and establishes a new connection with a telegram bot once you click on it. The end-user should NOT have a Telegram account. I already tried to implement Intergram but it's not exactly what I'm looking for, as it merely forwards the message to a human using webhooks, and the bot is only used as a message broker. I have heard that some customization is possible using tdlib but I'm not sure if it can help me achieve the desired result.
How should I start implementing a chat window with my bot on a website?

Google hangout chat data with out bot

Is there a way to read the data from the chat messages in DM or Group with out adding the bot the DM or Group?
Similar to the APIs that are available to programmatically access the google drive, is there a way ?
Answer:
No, there isn't.
More Information:
The only API access you can get for Hangouts chat rooms is by using a bot. You can also use a webhook, but this is only for sending messages and not receiving.
You will need to use a bot to be able to do this.

Go to chat message with specific text with Telegram API

I'm looking for information about this, but I don't find anything.
Is possible send to user to a chat message that contains a specific text?
This request below can be made with multiple languages.
https://api.telegram.org/bot[BOT_API_KEY]/sendMessage?chat_id=[MY_CHANNEL_NAME]&text=[MY_MESSAGE_TEXT]
where:
BOT_API_KEY is the API Key when you created your bot
MY_CHANNEL_NAME is the handle of your channel (e.g. #my_channel_name)
MY_MESSAGE_TEXT is the message you want to send (URL-encoded)
https://medium.com/#xabaras/sending-a-message-to-a-telegram-channel-the-easy-way-eb0a0b32968

Is it possible to pin a message using Telegram API?

Is it possible to pin a message using the Telegram API? I would like to create a bot to pin messages in a chat group. I was unable to find an specific method to do it in the documentation:
https://core.telegram.org/bots/api
Is there any way to do it?
Thanks.
you should first turn off the group privacy mode of your bot in your BotFather panel.
then, your bot should be the admin of that chat in order to be able to pin messages.
finally, you can use pinChatMessage, unpinChatMessage to do the task.

Is it possible to build a telegram bot that aggregates posts of multi telegram channel?

Requirments:
1- Have a feed of posts that aggregate all posts of multi channels
2- have actions (bot command) on each post
3- When post of channel edited, correspondent post in the telegram bot edited too.
(If it is not possible, I want to know is it possible to edit a message that was sent to multiple recipients in one action or i have to change each of them by message id, chat id)
You can assume you are owner of all these channels and you set your bot as admin of all of them
Only creator/admins can add bots to channels and only as admins.
Bots (for now) can't read messages in channels.
Bots (for now) can't view any counters in channels.
So no such bot for now :(