send_messages = False)
How do I get it from a group?
event.chat_id
false, boy
edit_permissions raise ValueError('You must pass a user entity') ValueError: You must pass a user entity
if you don't have the user why are using a function that literally restricts a user in a chat if you want to restrict the dude who sends 'test' user = await event.get_sender() and don't use .chat.id, use chat = event.get_chat() and pass it directly. no need to explicitly get the id, it's bad and unsigned. Or if you want to restrict the whole chat and not a user, just remove user argument from the beginning, only give it the chat
Restriction of one user who wrote the word test text = event.raw_text if 'test' == text:
user = await event.get_sender() chat = await event.get_chat() await client.edit_permissions(chat, user, timedelta(minutes = 1), send_messages = False)
no True Boy
you only need the chat id and user id
Обсуждают сегодня