Answer the question
In order to leave comments, you need to log in
Why can't the bot add a user to administrators?
The bot has administrator rights (to assign admins, including), while using the promote_chat_member function, I get an error of this nature:
Unauthorized: Forbidden: right_forbidden
@dp.message_handler (Command("admin", prefixes="!/"))
async def admin(message: types.Message):
Chat = message.chat.id
user = message.from_user.id
await bot.promote_chat_member(user_id=user,chat_id=Chat,can_edit_messages=True)
Answer the question
In order to leave comments, you need to log in
@dp.message_handler (Command("admin", prefixes="!/"))
async def admin(message: types.Message):
Chat = message.chat.id
await bot.promote_chat_member(user_id="",chat_id=Chat,can_edit_messages=True)
So, for a moment, if this is about discord, then the administrator cannot give the role of his own group. Even if he is an administrator, the group he gives out must be strictly lower than the one to which he belongs. Just create another group with the same rights right after the bot and issue it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question