diff --git a/EzTg/main.py b/EzTg/main.py index 9d0a752..4204a79 100644 --- a/EzTg/main.py +++ b/EzTg/main.py @@ -216,7 +216,19 @@ async def forwardMessage(self, async def getMe(self): """Get information about the bot.""" r = await self.send("getMe") - user = User(r["id"], r["is_bot"], r["first_name"], r["last_name"], r["username"], r["language_code"], r["is_premium"], r["added_to_attachment_menu"], r["can_join_groups"], r["can_read_all_group_messages"], r["supports_inline_queries"]) + user = User( + r["id"], + r["is_bot"], + r["first_name"], + r["last_name"], + r["username"], + r["language_code"], + r["is_premium"], + r["added_to_attachment_menu"], + r["can_join_groups"], + r["can_read_all_group_messages"], + r["supports_inline_queries"], + ) return user async def copyMessage( diff --git a/EzTg/replykeyboardmarkup.py b/EzTg/replykeyboardmarkup.py index 38bc448..fc6680e 100644 --- a/EzTg/replykeyboardmarkup.py +++ b/EzTg/replykeyboardmarkup.py @@ -1,17 +1,65 @@ class ReplyKeyboardMarkup: - def __init__(self, is_persistent=False, resize_keyboard=False, one_time_keyboard=False, selective=False, input_field_placeholder=None): + + def __init__( + self, + is_persistent=False, + resize_keyboard=False, + one_time_keyboard=False, + selective=False, + input_field_placeholder=None, + ): self.keyboard = [[]] self.is_persistent = is_persistent self.resize_keyboard = resize_keyboard self.one_time_keyboard = one_time_keyboard self.selective = selective - - def add(self, text, request_user=None, request_chat=None, request_contact=False, request_location=False, request_poll=False, web_app=None): - self.keyboard[-1].append({"text": text, "request_user": request_user, "request_chat": request_chat, "request_contact": request_contact, "request_location": request_location, "request_poll": request_poll, "web_app": web_app}) - - def add_new_row(self, text, request_user=None, request_chat=None, request_contact=False, request_location=False, request_poll=False, web_app=None): + + def add( + self, + text, + request_user=None, + request_chat=None, + request_contact=False, + request_location=False, + request_poll=False, + web_app=None, + ): + self.keyboard[-1].append({ + "text": text, + "request_user": request_user, + "request_chat": request_chat, + "request_contact": request_contact, + "request_location": request_location, + "request_poll": request_poll, + "web_app": web_app, + }) + + def add_new_row( + self, + text, + request_user=None, + request_chat=None, + request_contact=False, + request_location=False, + request_poll=False, + web_app=None, + ): self.keyboard.append([]) - self.keyboard[-1].append({"text": text, "request_user": request_user, "request_chat": request_chat, "request_contact": request_contact, "request_location": request_location, "request_poll": request_poll, "web_app": web_app}) - + self.keyboard[-1].append({ + "text": text, + "request_user": request_user, + "request_chat": request_chat, + "request_contact": request_contact, + "request_location": request_location, + "request_poll": request_poll, + "web_app": web_app, + }) + def send(self): - return {"reply_markup_keyboard": self.keyboard, "is_persistent": self.is_persistent, "resize_keyboard": self.resize_keyboard, "one_time_keyboard": self.one_time_keyboard, "selective": self.selective} \ No newline at end of file + return { + "reply_markup_keyboard": self.keyboard, + "is_persistent": self.is_persistent, + "resize_keyboard": self.resize_keyboard, + "one_time_keyboard": self.one_time_keyboard, + "selective": self.selective, + }