I have a telegram bot that I send messages to via Python. I would like another user to be able to see these messages as well. Can't seem to figure out how to do it, nor what to do?
Related
As a telegram bot api developer, I noticed a weird behaviour of the getUpdates() api method:
If the user have not interacted with the bot for a few days, then the next time it sends a message to the bot, the message does not get delivered via the long-poll.
The workaround is to "cleanup the chat" - then all of a sudden the messages get delivered again. But this workaround is ugly.
What can be the cause of this issue, and is there any "lighter" workaround that will not touch the chat history?
I have created a Telegram Bot. As per the docs - https://core.telegram.org/bots any other telegram user can send messages to the bot
Users can interact with bots in two ways:
Send messages and commands to bots by opening a chat with them or by adding them to groups.
Now other users are being allowed to send messages, but those messages do not show on the bot chat. Am I missing to configure something?
Thanks,
Anand
I am able to send messages from python to Telegram, but I cant seem to find the reverse.
I need to get the message from telegram channel and send it to a certain server using Api. Server can consume that Api and that's not my question. I need to know if Telegram can generate that post request.
Your bot should be a member or administrator of that channel. And then your bot will receive an update containing channel_post.
Note: You can't join your bot to channels or groups unless you're the owner or administrator of the channel. (Bots themselves do not have the ability to join, you add them manually)
A web service that contains all the methods for processing data is stored by Azure. In this case, only my telegram can process this data. Other applications are not allowed. But there is a possibility of expanding the service.
How do I know that the service is used by my telegram bot?
How to authenticate the application.
Well, I tried to use OAuth2.0, but i think it is not correct, because user is already authentificated with telegram, when he use telegram bot. My idea was to send a link to google auththentification in the beginning of bot job. By th way, ok, we know user`s data. May be I can check: Id, login etc. But some hacker can substitute this id
How can I make sure that Webhook requests are coming from Telegram? If
you‘d like to make sure that the Webhook request comes from Telegram,
we recommend using a secret path in the URL you give us, e.g.
www.example.com/your_token. Since nobody else knows your bot’s token,
you can be pretty sure it's us.
Telegram Bot FAQ
I wrote a telegram bot, but it go frizes sometimes, and don't answer to the messages.
How to check the state of bot automaticaly (for exmaple from another server).
I think, that I need something like heartbeat check:
Send a message from non-webhook server.
Catch telegram response
If response not comes in reasonable time, bot is die.
But, I need telegram client on linux server to do it.
Do you have any ideas, how to check telegram bot state?
You need to find out why the bot freezes, the health check is not the answer to your problem. However If you really want to implement some kind of automated health check, you need to use Telegram CLI to send requests to your own bot in fixed intervals and check for incoming messages from that CLI user.
If you are experiencing problem with Telegram's webhook, try long pulling the updates using the getUpdates method. I know a few high traffic bots that use that method, Webhooks have a max amount of concurrent requests so if you just delay them for a few milliseconds, it will start accumulating delay.