I’m trying to change the rights of group members/administrators according to the example in the telethon documentation:
https://telethonn.readthedocs.io/en/latest/extra/examples/chats-and-channels.html#admin-permissions,
But the problem is that the required ChannelAdminRights class simply does not exist and I get an ImportError error: cannot import name ‘ChannelAdminRights’ from ‘telethon.tl.types’
How do I change my member rights? (I use Google Translate)
Question posted in Telegram API
A comprehensive official documentation can be found here.
A comprehensive official documentation can be found here.
2
Answers
Yeah, that's exactly what I need! I just ran this code and faced with the problem that this method works only for channels and megpgroup, and I have a chat... Error text: raise ValueError('You must pass either a channel or a supergroup') ValueError: You must pass either a channel or a supergroup
This might help you:
https://docs.telethon.dev/en/latest/modules/client.html?highlight=restrict#telethon.client.chats.ChatMethods.edit_permissions
Here’s the code:
With this code, a bot/userbot will mute for one hour an user.