When I chat with a telegram user, I can see for each user their "last seen" - when they last connected to Telegram (even if I haven't chatted with them for a while).
Is there a way to query for this information via the bot API? I haven't found a way to access it.
Last seen recently — covers anything between 1 second and 2-3 days. Last seen within a week — between 2-3 and seven days. Last seen within a month — between 6-7 days and a month. Last seen a long time ago — more than a month (this is also always shown to blocked users)
In order to send a message to "@Username", you will need them to start your bot, and then store the username with the user_id. Then, you can input the username to find the correct user_id each time you want to send them a message.
It's impossible to see the owner of a Telegram Bot according to Telegram MTProto protocol. Probably only Bot Support and Telegram Abuse has access to this informations.
It's not possible with the Telegram Bot API. But it's possible with Telegram API which allows you to build your own customized Telegram clients, and have other methods like read messages, or status (limited by the target users' privacy settings, of course).
After generate an hash to authenticate your API client on my telegram, you can use a library like Telegram-MTProto to call contacts.getStatuses which return an array of ContactStatus and know if user is online or offline.
const getStatuses = async () => {
const statuses = await telegram('contacts.getStatuses', {})
// Check online status
if(statuses[0].status._ === 'userStatusOnline')
// Online
}
That's currently not possible with the Telegram Bot API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With