I started working a few weeks ago on telegram's bots. For that I've read in the specifications there is no way to create a private bot from botfather. The only way is using a custom command like /password to send a password to the bot and then keep the chat id of the client (when password is correct of course ...).
To help your Telegram bot be as secure as possible, limit access to only the IPs Telegram is sending updates from. You can also limit IP access on the server side.
Anyone can find and use them. However, Telegram bots can also only be made accessible to certain users if a separate communication channel with the bot is set up.
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.
You can do this in setting, you need to check by yourself, just exit program if .message.from.id
not equal to yours.
You can disable join group via /setjoingroup
, but you can't invite bot to group either.
There is nothing you can do with BotFather. the only way is to check it inside your code.
You can check for the chat id (9 digit number) in your code.
For example, if you use this wrapper to create bot, you can use update.message.chat_id
to get chat id. You can also check for the first name (update.message.from_user.first_name
) and last name (update.message.from_user.last_name
).
I started working a few weeks ago on telegram's bots. For that I've read in the specifications there is no way to create a private bot from botfather. The only way is using a custom command like /password to send a password to the bot and then keep the chat id of the client (when password is correct of course ...). Your bot need to accept commands only from memorized/autentificated chat id as you would do it in a classical way for any other application.
There's another option described in the telegram docs.
You can use a deeplink to get a unique key from the link and secure your bot. Denying access in your code to anyone who does not have the key.
From the docs:
$memcache_key = "vCH1vGWJxfSeofSAs0K5PA"
$memcache_key
into Memcache for 3600 seconds (one hour)telegram_chat_id
for the user 123. Remove the key from Memcache.telegram_chat_id
. If yes, use the sendMessage
method in the Bot API to send them a message in Telegram.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