handle deleted message by user in telegram bot - telegram-bot

Is there any way that can handle deleted message by user in one-to-one chat or groups that bot is member of it ?
there is method for edited message update but not for deleted message .

No. There is no way to track whether messages have been deleted or not.

The pyrogram have DeletedMessagesHandler / #Client.on_deleted_messages(). If used as Userbot, It handles in all chat groups channels. I failed to filter. Maybe it will work in a bot

Related

How to get authenticated by Telegram bot in Group chats?

Please kindly someone explain me how can the Telegram bot could understand who is sending the command in group chats and respond it with the the unique answer which is just for that user.
Surely in this case security issues should be considered and a user must not send command as another user.
I guess I can use username to send along with command.
Any suggestions...
The Message Object contains two objects apart from other objects:
Chat, message['chat'] which represents the Chat from which the message is coming. In your case the group.
User, message['from'] which represents the user that sent the message/command.
So it's easy to differentiate which user sent the message. And in case of Private chats, both the Chat object and the User Object are same.

Is that possible a telegram bot can remove messages from group

i want create telegram bot .
It can join to the group and delete messages in group .
Is that possible a telegram bot can remove messages from group ?
i search and some people say yes it possible , some people say no
Check this link out, it seems the new bot API made it possible with some restrictions:
https://core.telegram.org/bots/api#deletemessage
The following details are from telegram API page:
A message can only be deleted if it was sent less than 48 hours ago.
Bots can delete outgoing messages in groups and supergroups.
Bots granted can_post_messages permissions can delete outgoing messages in channels.
If the bot is an administrator of a group, it can delete any message there.
If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
Returns True on success.
This is now outdated, please see Darkc0d3r's answer
Using the Telegram Bot API? No, there is no such functionality as of now.
However you can if you are using the Telegram API, where you can use the messages.deleteMessages method, which requires you to give it a list of message id's as a parameter.
You can use
bot.DeleteMessageAsync(chatId, messageId)
you should make it in a try catch in case the message doesn't exist anymore or you have a wrong messageId,
messageId is a property which you get in MessageEventArgs.Message,
Note: the chatId should be the Group/Channel chatId and not of the user who sent it, get that in Chat.Id property of MessageEventArgs.Message ...

How to know if user has seen a message sent by my bot in Telegram?

I'm developing a Telegram bot, and I want to know whether a user, that has started a private chat with my bot, has seen a certain message sent by bot, and to know when has he seen it.
Is it possible to do so?
Thank you very much.
That's currently not possible.
I'm using this solution.
Create a channel specially for your bot
Let your robot send message from this channel to users, you can use forward method.
Now you can see how many users have seen your message
Telegram Bot API has limit functionality. There is absolutely no way to get message view count at the time of this comment.
Usually TDLib can be used instead of Telegram Bot. It is Telegram client library. You can use it directly or make it as services for BOT to call.
For example. use TdApi.GetMessage to get the message, and the returned message has field of interactionInfo which contains forwardCount or viewCount.
perhaps this answer help you :
in the end of your message place
link example : yoursite.com\checkvisit.php?id=1234
when user open message link automatic run for telegram ...
you can understand message was read
you must in checkvisit.php set to check db if id exist and not read set it to read
then id in db remove or disable
but this method simple - telegram must add 1 parameter to return this
sorry my english not good
it is not possible yet , you might want to search for Madeline bot

Send message to th all of bots users (telegram api)

how to send Send message to the all of bots users?
There is no way to sned message to all ?
what is the method name ?
From Official API FAQ:
How can I message all of my bot's subscribers at once?
Unfortunately, at this moment we don't have methods for sending bulk messages, e.g. notifications. We may add something along these lines in the future. (...)
Obviously, if you store users chat_id, you can send individual message to all users (I use this method).
Navid wants to send message to all subscribers via bot.
If subscribers are more than 100 persons bot will very slow to sending all messages and may doesn't send messages to all.
Navid's question was how we can send message without this problem?
you can send with curl_multi_exec
Currently, a developer would need to implement a special broadcasting function that would send the message to each active user at the time adding a small delay to avoid hitting the rate limit of 30 messages per second (see https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once). This would mean that a very popular bot with say 10K active users cannot give timely notification as the last user would get the message about 5 minutes after the first user.
Here is a feature request to ask to add a method in the Bot API to broadcast a message to all its active users at once. You can upvote this feature request. https://bugs.telegram.org/c/8463

How can I send message to specific chatID?

I have chatId and want send messages while execute some tasks from java code. I found this explain on telegram "Bots can't initiate conversations with users. A user must either add them to a group or send them a message first. People can use telegram.me/ links or username search to find your bot." But my task works good when I use https request directly from browser. My bot perfectly answer for requests but how I can do this without user request?
I can not truly understand your case!
Anyway, your bot can send a message to a chat ID Only if the user witch blongs to the specified chat ID added your bot (send start to a bot).
and if it happened then send your message with
/sendMessage