From bb3ccca333e0994c7dcf910919ebb981f4478687 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Mon, 5 Oct 2020 10:50:47 +0200 Subject: [PATCH] Fix Python 3.5 compatibility issue --- telethon/tl/custom/participantpermissions.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/telethon/tl/custom/participantpermissions.py b/telethon/tl/custom/participantpermissions.py index 3a1c098e..44db3453 100644 --- a/telethon/tl/custom/participantpermissions.py +++ b/telethon/tl/custom/participantpermissions.py @@ -3,11 +3,24 @@ from .. import types class ParticipantPermissions: """ - Participant permissions information + Participant permissions information. + + The properties in this objects are boolean values indicating whether the + user has the permission or not. + + Example + .. code-block:: python + + permissions = ... + + if permissions.is_banned: + "this user is banned" + elif permissions.is_admin: + "this user is an administrator" """ - def __init__(self, participant, chat): + def __init__(self, participant, chat: bool): self.participant = participant - self.is_chat: bool = chat + self.is_chat = chat @property def is_admin(self):