Telegram bot check if user online - telegram

How can I check is user online or not, if I have users chat Id? I tryed bot.userStatus(myChat); but this is wrong.

Telegram Bot APIs don't offer any methods or object's attribute in order to get the user status, whether if he's online or not.
Your chatbot is able to gather user's information as soon as he wrote a message to the chatbot: these informations are the User's object fields as described into the Telegram Bot API documentation.
According to the available fields, user status (online, offline, etc.) unfortunately is not (yet) available.
According to another question posted here, it seems that getting the user status is possible via Telegram API so that creating a Telegram registered application which is not the same thing of using a Telegram Bot.

Related

Are "user" bots made with telethon allowed on Telegram?

I'm trying to make a bot for telegram using the telethon library. I would like my bot to be able to retrieve all members of any group that it's been added to which is not currently possible with the telegram bot API.
Because of this limitation, I made a new telegram account/app for my bot (using a Google Voice number) to use the python telegram Client, telethon, to gain user level access to the telegram API.
After playing around with it for a bit, I received this error:
telethon.errors.rpcerrorlist.PhoneNumberBannedError: The used phone number has been banned from Telegram and cannot be used anymore. Maybe check https://www.telegram.org/faq_spam (caused by SendCodeRequest)
After trying to login again from my phone I received a similar notification:
This phone number is banned.
I submitted a support ticket which was never responded to, but I was somehow able to login again with the Google Voice number the next day.
My question is: are we allowed to make bots for telegram with user level permissions using the telethon client? I cannot find any explicit rules about this in the telegram API ToS. However, the telethon docs mention in passing:
If your application ever needs user features because bots cannot do certain things, you will be able to easily login as a user and even keep your bot without having to learn a new library.
You're allowed to use any userbots. the ban probability is exact same as of an unofficial app of Telegram in Google play and other platform.
You're however going to be suspected and pre-banned by Telegram if you're from certain countries or you use VOIP phone numbers. Telegram doesn't like such numbers and might require you appeal to unban it manually.
It's fully their decision.
i, have been using my account in forks and userbots, etc.. for many years, so new accounts are suspected to be up to no good and frozen. try with your own number or buy extra legit one.
Telegram is pretty spammy platform and lately they have increased the ban situation.

Is it possible to send message from my account with interval in Telegram?

I need to send message from my own account with my nickname and profile (not from bot account) to any selected contact or group. How can I do that? I found bots with similar behaviour but messages are sent from bot account not from my profile which is what I need.
what you're looking for is a so-called "userbot" or "selfbot", i.e. a bot that works with the Telegram API in contrast to the Telegram Bot API. Searching for Telegram userbot library <your preferred programming language> should probably get you started.

how to read/receive telegram channel messages in my telegram bot?

i'm trying to create a bot which can read/receive all messages in a specific channel and send them to me .
my problem here is that i can't find a way to access those messages in my bot
important thing is:
i'm not admin or creator of that channel
i don't want to ask the creator to add my bot as administrator
i've searched in google but i wasn't able to find a solution
and i'm also sure that it is possible to do it, because there are already some junction bots with exact same performance .
any references or suggestions are appreciated .
As already pointed out in the Telegram group of python-telegram-bot, bots can't receive messages from channels where they are not an admin. If you want something like this, you'll have to use a user bot, e.g. a program that controls your private Telegram account (in contrast to controlling a bot account). See here for some info on user bots.
Note that also the provider that you linked seems to be using userbots behind the scenes. More precisely, the docs on the so called "DirectConnection" state that you need to enter a phone number (associated to a telegram account) and then "Follow the instructions" which probably just means to enter the verification code that Telegram sends you. Phone number + verification code is exactly what is needed to control your private Telegram account.
Disclaimer: I'm currently the maintainer of python-telegram-bot.

How can I programatically get a Telegram Bot's info

As per the Telegram Bot API's documentation I see it is possible to retrieve a bot's name (using getMe).
It is also possible to retrieve a botpic of a specific bot (using getUserProfilePhotos).
I've read Telegram's documentation again and again and I cannot find a way to obtain either of a Telegram bot's Description, About or Commands.
Also I cannot find any way to check what a specific bot's allow groups, group privacy and domain are set to.
Are Telegram Bots in some alpha/experimental state ?
It's a powerful idea but I see they lack most of the features you (as a developer) would expect them to have.
I see there are a lot of random features instead.
How could I retrieve the upper properties (Description, About, Commands) for a specific bot using the Telegram Bot API ?
How could I retrieve a specific bot owner account's info, phone number Telegram Bot API ?
P.S: I have all the tokens of the bots I am about to retrieve the upper information for.
You can't with the bots API but it will be possible with userbot (a bot running as regular telegram account) using client API.
Obtaining number and information of the bot owner would be leaking of private data, privacy...

Telegram: How to add another(existing) bot to bot_father?

How can I add another existing bot to my BothFather in telegram?
I have my own bot and I can see it in BotFather and now I am asked to manage another bot (which I have its security key).
But I could not see this bot in my BotFather(obviously, because I did not create it) and I could not find any way to add this second bot into my BotFather in order to change its info or default commands list.
If I understand correctly, you have a bot that you created yourself with #BotFather and you can manage its commands, info etc. by talking to BotFather.
Then you have been asked to manage another bot created by someone else and you have been given its token.
Let me tell you that you cannot change the info of the Bot created by someone else. i.e. you don't have the ownership of the Bot.
Bot Ownership transfer is a feature that Telegram Support said will consider in future.
As far as making the bot work, by using the API Token you can go through their Bot API Documentation.
[EDIT]
With Bot API 5.0, it's now possible to Transfer the bot ownership.

Resources