From 29091293f55da42bb20e0bda7a711a3fc12bcff4 Mon Sep 17 00:00:00 2001 From: Luna Date: Tue, 31 Mar 2020 16:34:41 -0300 Subject: [PATCH] black fmt pass --- litecord/blueprints/guild/emoji.py | 1 - litecord/blueprints/guild/roles.py | 1 - litecord/blueprints/guilds.py | 9 +++++++-- litecord/blueprints/icons.py | 3 ++- litecord/images.py | 1 - litecord/schemas.py | 28 ++++++++++++++++++++++++---- 6 files changed, 33 insertions(+), 10 deletions(-) diff --git a/litecord/blueprints/guild/emoji.py b/litecord/blueprints/guild/emoji.py index 9f6bcf2..74f5740 100644 --- a/litecord/blueprints/guild/emoji.py +++ b/litecord/blueprints/guild/emoji.py @@ -179,4 +179,3 @@ async def _del_emoji(guild_id, emoji_id): await _dispatch_emojis(guild_id) return "", 204 - diff --git a/litecord/blueprints/guild/roles.py b/litecord/blueprints/guild/roles.py index ce39197..4bd6b71 100644 --- a/litecord/blueprints/guild/roles.py +++ b/litecord/blueprints/guild/roles.py @@ -311,4 +311,3 @@ async def delete_guild_role(guild_id, role_id): ) return "", 204 - diff --git a/litecord/blueprints/guilds.py b/litecord/blueprints/guilds.py index 4b88a7b..faf6670 100644 --- a/litecord/blueprints/guilds.py +++ b/litecord/blueprints/guilds.py @@ -302,7 +302,7 @@ async def _update_guild(guild_id): raise BadRequest("guild does not have PUBLIC feature") await _guild_update_icon("discovery_splash", guild_id, j["discovery_splash"]) - + fields = [ "verification_level", "default_message_notifications", @@ -323,7 +323,12 @@ async def _update_guild(guild_id): guild_id, ) - channel_fields = ["afk_channel_id", "system_channel_id", "rules_channel_id", "public_updates_channel_id"] + channel_fields = [ + "afk_channel_id", + "system_channel_id", + "rules_channel_id", + "public_updates_channel_id", + ] for field in [f for f in channel_fields if f in j]: # setting to null should remove the link between the afk/sys/rules/public updates channel # to the guild. diff --git a/litecord/blueprints/icons.py b/litecord/blueprints/icons.py index 9f4dbb5..fc6eec3 100644 --- a/litecord/blueprints/icons.py +++ b/litecord/blueprints/icons.py @@ -109,7 +109,8 @@ async def _get_guild_banner(guild_id: int, icon_file: str): icon_hash, ext = splitext_(icon_file) return await send_icon("banner", guild_id, icon_hash, ext=ext) + @bp.route("/discovery-splashes//", methods=["GET"]) async def _get_discovery_splash(guild_id: int, icon_file: str): icon_hash, ext = splitext_(icon_file) - return await send_icon("discovery_splash", guild_id, icon_hash, ext=ext) \ No newline at end of file + return await send_icon("discovery_splash", guild_id, icon_hash, ext=ext) diff --git a/litecord/images.py b/litecord/images.py index 97e9d92..d13f997 100644 --- a/litecord/images.py +++ b/litecord/images.py @@ -528,4 +528,3 @@ class IconManager: await self.delete(old_icon) return await self.put(scope, key, new_icon_data, **kwargs) - diff --git a/litecord/schemas.py b/litecord/schemas.py index 1dc35b1..82f2634 100644 --- a/litecord/schemas.py +++ b/litecord/schemas.py @@ -287,13 +287,33 @@ GUILD_UPDATE = { "verification_level": {"type": "verification_level", "required": False}, "default_message_notifications": {"type": "msg_notifications", "required": False}, "explicit_content_filter": {"type": "explicit", "required": False}, - "afk_channel_id": {"type": "snowflake", "coerce": int, "required": False, "nullable": True}, + "afk_channel_id": { + "type": "snowflake", + "coerce": int, + "required": False, + "nullable": True, + }, "afk_timeout": {"type": "number", "required": False}, "owner_id": {"type": "snowflake", "coerce": int, "required": False}, - "system_channel_id": {"type": "snowflake", "coerce": int, "required": False, "nullable": True}, + "system_channel_id": { + "type": "snowflake", + "coerce": int, + "required": False, + "nullable": True, + }, "features": {"type": "list", "required": False, "schema": {"type": "string"}}, - "rules_channel_id": {"type": "snowflake", "coerce": int, "required": False, "nullable": True}, - "public_updates_channel_id": {"type": "snowflake", "coerce": int, "required": False, "nullable": True}, + "rules_channel_id": { + "type": "snowflake", + "coerce": int, + "required": False, + "nullable": True, + }, + "public_updates_channel_id": { + "type": "snowflake", + "coerce": int, + "required": False, + "nullable": True, + }, "preferred_locale": {"type": "string", "required": False, "nullable": True}, "discovery_splash": {"type": "string", "required": False, "nullable": True}, }