I have a problem with telegram bot api.
when i was set webhook,then one of client send a photo to our bot and telegram api send frequently obejct of this photo to our api with the same update_id
this is answer from telegram support:
most probably issue is that you are not answering with a "2XX" to our requests, so we are sending the same updete as we understand that it wasn't received.
whats problem?!
The problem is you are not returning the proper status code (200) to Telegram so it thinks you did not receive the message successfully.
Related
Telegram In Dart or http request
How to get group all messages by using dart or http
Note that I have my bot token and I wanna use it in dart ("No another Languages") or http
Currently you can't get old messages from a group with the Bots API.
You can save every message in a database for a later use, but old messages are not accessible. The only way is by using the client API.
I want to know if it possible to send message to my telegram bot as a user.
Maybe I should send a request with my credentials? Or I am completely missing something?
UPD:
Ok I see it is not clear. I want to send message using program.
Open your Telegram App, search for your bot and open the chat with it. Then type a message and hit send.
Is it possible to send a message via Telegram API to the Saved Messages chat?
I have been looking all over the internet but could not find any information. I would think this would be possible.
If you mean the main mtproto api, yes you can send yourself a message by your id or username and telegram will place it in saved messages.
You did not mention which API you use, but this is how you do it in Telethon:
client.send_message("me", "hello")
But if you mean bot api, it's not possible for bots to send messages to your saved message.
I'm trying to figure out why my bot is not aware of his own messages on a channel, when I use bot.get_updates() I receive only messages written by me and not by the bot.
According to the python-telegram-bot API description, getUpdates fetches the messages sent to your bot, not the messages your bot sent. So it is intended behaviour that getUpdates would not be aware of the messages sent by your bot.
As a sidenote, as stated in the Telegram Bots FAQ, Telegram bots cannot access messages sent by other bots, regardless of the settings.
I tried this:
https://api.telegram.org/botXXtokenxx/sendMessage?chat_id=chat_id&text=text
But this is to send a message from the bot.
But what I need to do to send to the bot? (not from the bot)
You can either use a regular Telegram client (Telegram, Telegram X, Telegram Desktop, etc) to do it manually, or if you need an API (for whatever reason)...
You need the client API.
https://core.telegram.org/#getting-started
Once you have an API key for the client API and all that, you can send messages as explained here.
https://core.telegram.org/method/messages.sendMessage
Note that a human should be triggering this, as Telegram encourages (may be against ToS?) using a bot API for programatic access rather than the client API.