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

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

Related

How to avoid Bot repeating command in groups?

I created a new Telegram Bot which maintains a simple list. When I chat with the Bot directly (in PMs) the Bot works as intended.
I created this bot for a group of friends, so I added the bot to the group, and now, whenever I execute a command, the bot responds, but also repeats my command. Is there any way to avoid this behavior?
I am using the python-telegram-bot API and sending messages using update.message.reply_text('My message')
Is this just intended behavior or is there any way to avoid the bot repeating the sent command?
The bot only is replying message, not creating 2 messages.
You should use send_message.
I found the solution. Telegram API understands this as quoting, and is enabled in groups by default, disabled in private chats.
It can be disabled by using:
update.message.reply_text("message", quote=False)

Telegram bots - how can we detect that a user has started typing?

We can get Telegram messages when they are complete and sent via long polling or webhooks, but is there a way to understand when the user has started typing?
I guess this is not a normal case for bots and I dont think there is a straight away method but could we fall back on the Telegram API for messaging apps for that?
Well, actually I found a solution in the current Bot API; inline queries. While they are not intended for this, inline queries send what the user types in to the bot in real-time, so you are alerted as soon as the first characters are typed in.
There is a way in Telegram Core API, named: updateUserTyping.
But there is not any way in Telegram Bot API yet (until today: 2016-10-17).
If you type or send a file to the bot during these processes you do not get any message from Telegram in your webhook, but it's possible they'll add a new feature to detect user typing in future Bot API updates.

Send email to pushbullet?

The website "PushBullet.com" is webwashed(filtered) by our proxy, at work.
But I really need to send some notifications to my devices.
Is there a way to send them thru the good old email protocol ?
So there is no officially supported feature for this, but you can sort of fake it using the existing email-to-push feature.
Send a push to an email address that is not a pushbullet account, such as yourgmailaccount+randomstring#gmail.com. It will have a from address of someotherrandomstring#pushbulletuseremail.com.
You can then send emails to that address, and they should show up in your pushes list.
Proposed method with random strings in email address doesn't work.
This method works. Not an email, just pure notification as required.
The library developer suggests also command line notification send. Simple and handy.
I was looking to do something similar so I could get pushbullet notifications from cron jobs, and came across this:
https://github.com/side2k/email2pb
I haven't gotten a chance to try it yet but I think this will do what you're wanting. Just tested it, and it works really well if you're able to run a postfix server.
I use Zapier for this (you can do it with a free account).
Set up a Zap to search for new mail under a label (I use "pushbullet-notify"), and send any message there to Pushbullet.
Then in Gmail just create filters for any mails you want PB notifications on, applying the same label.
The notification may be delayed up to 15 minutes from the time the email is received and labeled (free accounts check every 15 minutes).

PHP script to send and retrive sms from a website

I'm not sure where to begin, but got a case I need help from others where and if possible to solve.
Thing is, got a new alarm system at home, this system uses sms function so I can send a short code to my alarm asking for status if it`s ON or OFF, or i can turn it on/off from an sms.
Since both the sms number and code is strictly personal, I would not like to tell my carpenter the codes, but in the mean while he is working at my home, I can give him a login to my site, where he can see if the alarm is turned on or even turn it on/off by him self.
I would like to build me a website, that does the same.
Got a login to my site, when logged in, i would like the website to send an sms automatically, then retrieve the answer and display it on the website.
Is this even possible ? If so, anyone can past me in the right direction here ?
Thanks in advance =)
You can send an SMS from a website. Most mobile operators will gladly offer you an apropriate API.
For instance Deutsche Telekom has an API called "Developer Garden" that allows you to send SMS via a WebService and much more.
see here for an example: www.developergarden.com
Other providers may also offer such services.
you need an sms gateway ( we use these guys : http://inteltech.com.au/, but nearly any will do )
Your easiest option is to find one where you can insert SMS'es for sending via a URL, eg in our case the URL looks like this:
http://inteltech.com.au/secure-api/send.single.php?username=[user]&key=[longcode]&method=http&senderid=[id]&sms=[phonenumber]&message=[here's the message]
it's extremely simple to use. If your site handles the login otherwise, then you can use this for the rest.
Now, how to receive SMS'es is a bit tricker :)
But this provider, for example, offers you options to;
Send the reply as an email to a nominated email address.
Send the reply as an email to the original user who sent the message.
Send the reply as an SMS to a nominated mobile number.
POST the reply to your website or application . e.g. We can call a http/https request to your script
as you can see, both the email and the POST options are providing great ways to integrate.
I'd say if you don't handle incoming email already, then stick to the POST method.
voila :)

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