diff --git a/litecord/blueprints/guild/mod.py b/litecord/blueprints/guild/mod.py index e294b61..f108956 100644 --- a/litecord/blueprints/guild/mod.py +++ b/litecord/blueprints/guild/mod.py @@ -131,8 +131,8 @@ async def remove_ban(guild_id, banned_id): async def get_prune(guild_id: int, days: int) -> list: """Get all members in a guild that: - - did not login in ``days`` days. - - don't have any roles. + - did not login in ``days`` days. + - don't have any roles. """ # a good solution would be in pure sql. member_ids = await app.db.fetch( diff --git a/litecord/blueprints/guild/roles.py b/litecord/blueprints/guild/roles.py index 4bd6b71..265ccf8 100644 --- a/litecord/blueprints/guild/roles.py +++ b/litecord/blueprints/guild/roles.py @@ -307,7 +307,10 @@ async def delete_guild_role(guild_id, role_id): await app.dispatcher.guild.dispatch( guild_id, - ("GUILD_ROLE_DELETE", {"guild_id": str(guild_id), "role_id": str(role_id)},), + ( + "GUILD_ROLE_DELETE", + {"guild_id": str(guild_id), "role_id": str(role_id)}, + ), ) return "", 204 diff --git a/litecord/common/guilds.py b/litecord/common/guilds.py index 57c7b82..715688c 100644 --- a/litecord/common/guilds.py +++ b/litecord/common/guilds.py @@ -54,7 +54,11 @@ async def remove_member(guild_id: int, member_id: int): await app.dispatcher.guild.unsub(guild_id, member_id) await app.lazy_guild.remove_member(guild_id, user["id"]) await app.dispatcher.guild.dispatch( - guild_id, ("GUILD_MEMBER_REMOVE", {"guild_id": str(guild_id), "user": user},), + guild_id, + ( + "GUILD_MEMBER_REMOVE", + {"guild_id": str(guild_id), "user": user}, + ), ) diff --git a/litecord/gateway/websocket.py b/litecord/gateway/websocket.py index e6b9161..a2e037e 100644 --- a/litecord/gateway/websocket.py +++ b/litecord/gateway/websocket.py @@ -382,8 +382,7 @@ class GatewayWebsocket: app.sched.spawn(self._guild_dispatch(guilds)) async def _check_shards(self, shard, user_id): - """Check if the given `shard` value in IDENTIFY has good enough values. - """ + """Check if the given `shard` value in IDENTIFY has good enough values.""" current_shard, shard_count = shard guilds = await self.app.db.fetchval( diff --git a/litecord/presence.py b/litecord/presence.py index 2951c13..d9c8a60 100644 --- a/litecord/presence.py +++ b/litecord/presence.py @@ -206,7 +206,8 @@ class PresenceManager: user = await self.storage.get_user(user_id) await app.dispatcher.friend.dispatch( - user_id, ("PRESENCE_UPDATE", {**presence.partial_dict, **{"user": user}}), + user_id, + ("PRESENCE_UPDATE", {**presence.partial_dict, **{"user": user}}), ) async def dispatch_friends_pres_filter( diff --git a/litecord/pubsub/dispatcher.py b/litecord/pubsub/dispatcher.py index cb7507a..376aea5 100644 --- a/litecord/pubsub/dispatcher.py +++ b/litecord/pubsub/dispatcher.py @@ -126,7 +126,8 @@ class DispatcherWithState(Dispatcher[K, V, EventType, DispatchType]): class DispatcherWithFlags( - DispatcherWithState, Generic[K, V, EventType, DispatchType, F], + DispatcherWithState, + Generic[K, V, EventType, DispatchType, F], ): """Pub/Sub backend with both a state and a flags store.""" diff --git a/litecord/schemas.py b/litecord/schemas.py index 3469784..cbb4781 100644 --- a/litecord/schemas.py +++ b/litecord/schemas.py @@ -167,7 +167,10 @@ class LitecordValidator(Validator): return isinstance(value, str) and (len(value) < 32) -def validate(reqjson: Optional[Union[Dict, List]], schema: Dict,) -> Dict: +def validate( + reqjson: Optional[Union[Dict, List]], + schema: Dict, +) -> Dict: """Validate the given user-given data against a schema, giving the "correct" version of the document, with all defaults applied.