Answer the question
In order to leave comments, you need to log in
Admin on telebot?
I know there is a method with which you can write some command to a bot, for example /admin, and it only works when the creator of the bot sends (by its id)
And if sent, for example, by a beginner, he will be told that you do not have rights, etc.
How to do this ?
Answer the question
In order to leave comments, you need to log in
In the command handler, check who sent and that's it.
Perhaps there is something out of the box, but even so there is a banal if.
If you make an admin panel, then check for user_id, if it matches, then display your message.
admin = ['admin_chat_id' , 'admin_first_name' ]
..
..
def start(message):
if str(message.from_user.id) in admin and message.from_user.first_name in admin:
bot.send_message(message.from_user.id, 'Привет, великий!')
else:
bot.send_message(message.from_user.id, 'Пшел вон! незванный')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question