Answer the question
In order to leave comments, you need to log in
How to prohibit writing in telebot, but allow inviting friends?
Tell me why this does not work bot.restrict_chat_member(chat_id, user_id, can_invite_users=True) the
bot simply bans the user from everything, he cannot invite friends, although I set can_invite_users=True
Answer the question
In order to leave comments, you need to log in
I have suspicions that restrict_chat_member does not work correctly in the telebot library.
If you look at the Bot API documentation, it says that the permissions parameter , which is a JSON string , is substituted into the restrictChatMember method.
And the bot.restrict_chat_member method , if you dig around on the github, simply transfers all permissions without converting them to JSON and without putting them in a separate permissions argument.
Alternatively, call the restrictChatMember method directly with a Post request using the requests library, correctly passing all the necessary parameters there
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question