diff --git a/EzTg/main.py b/EzTg/main.py index cbc5e9f..4ac5e2b 100644 --- a/EzTg/main.py +++ b/EzTg/main.py @@ -1,5 +1,6 @@ import aiohttp import requests + from .user import User @@ -377,7 +378,7 @@ async def get_chat_id(self, message): message: `dict` The message object.s""" return message["chat"]["id"] - + async def get_sender_object(self, message): """Get sender object from message. @@ -386,5 +387,14 @@ async def get_sender_object(self, message): message: `dict` The message object.""" sender = message["from"] - user = User(sender["id"], sender["id_bot"], sender["first_name"], sender["last_name"], sender["username"], sender["language_code"], sender["is_premium"], sender["added_to_attachment_menu"]) - return user \ No newline at end of file + user = User( + sender["id"], + sender["id_bot"], + sender["first_name"], + sender["last_name"], + sender["username"], + sender["language_code"], + sender["is_premium"], + sender["added_to_attachment_menu"], + ) + return user diff --git a/EzTg/user.py b/EzTg/user.py index 4818c81..ff3ec41 100644 --- a/EzTg/user.py +++ b/EzTg/user.py @@ -1,6 +1,6 @@ class User: """Represents a Telegram user or bot. - + Attributes ---------- id: `int` @@ -25,7 +25,21 @@ class User: Optional. True, if privacy mode is disabled for the bot. Returned only in getMe. supports_inline_queries: `bool` Optional. True, if the bot supports inline queries. Returned only in getMe.""" - def __init__(self, id, is_bot, first_name, last_name, username, language_code, is_premium, added_to_attachment_menu, can_join_groups=None, can_read_all_group_messages=None, supports_inline_queries=None): + + def __init__( + self, + id, + is_bot, + first_name, + last_name, + username, + language_code, + is_premium, + added_to_attachment_menu, + can_join_groups=None, + can_read_all_group_messages=None, + supports_inline_queries=None, + ): self.id = id self.is_bot = is_bot self.first_name = first_name @@ -36,4 +50,4 @@ def __init__(self, id, is_bot, first_name, last_name, username, language_code, i self.added_to_attachment_menu = added_to_attachment_menu self.can_join_groups = can_join_groups self.can_read_all_group_messages = can_read_all_group_messages - self.supports_inline_queries = supports_inline_queries \ No newline at end of file + self.supports_inline_queries = supports_inline_queries