From 78745c3334f2556fac250332f9b18b2d6a5d4be3 Mon Sep 17 00:00:00 2001 From: grey-cat-1908 Date: Sat, 14 May 2022 17:38:52 +0300 Subject: [PATCH] fix with formatter --- melisa/client.py | 2 +- melisa/listeners/channel_create.py | 2 +- melisa/listeners/channel_delete.py | 2 +- melisa/listeners/guild_create.py | 2 +- melisa/listeners/guild_remove.py | 2 +- melisa/listeners/message_create.py | 2 +- melisa/listeners/ready.py | 2 +- melisa/models/app/cache.py | 8 +++++--- 8 files changed, 12 insertions(+), 10 deletions(-) diff --git a/melisa/client.py b/melisa/client.py index 5273db2..b659a92 100644 --- a/melisa/client.py +++ b/melisa/client.py @@ -74,7 +74,7 @@ class Client: mobile: bool = False, allowed_mentions: Optional[AllowedMentions] = None, logs: Union[None, int, str, Dict[str, Any]] = "INFO", - cache: CacheManager = None + cache: CacheManager = None, ): self._loop = asyncio.get_event_loop() diff --git a/melisa/listeners/channel_create.py b/melisa/listeners/channel_create.py index bc96bf5..fcf3b90 100644 --- a/melisa/listeners/channel_create.py +++ b/melisa/listeners/channel_create.py @@ -10,7 +10,7 @@ from ..utils.types import Coro async def channel_create_listener(self, gateway, payload: dict): channel = _choose_channel_type(payload) - await self.dispatch("on_channel_create", (channel, )) + await self.dispatch("on_channel_create", (channel,)) return diff --git a/melisa/listeners/channel_delete.py b/melisa/listeners/channel_delete.py index e80afab..28efe17 100644 --- a/melisa/listeners/channel_delete.py +++ b/melisa/listeners/channel_delete.py @@ -14,7 +14,7 @@ async def channel_delete_listener(self, gateway, payload: dict): channel = channel_cls.from_dict(payload) - await self.dispatch("on_channel_delete", (channel, )) + await self.dispatch("on_channel_delete", (channel,)) return diff --git a/melisa/listeners/guild_create.py b/melisa/listeners/guild_create.py index 6cee280..98d4f01 100644 --- a/melisa/listeners/guild_create.py +++ b/melisa/listeners/guild_create.py @@ -18,7 +18,7 @@ async def guild_create_listener(self, gateway, payload: dict): self.cache.set_guild(guild) if guild_was_cached_as_none is False: - await self.dispatch("on_guild_create", (guild, )) + await self.dispatch("on_guild_create", (guild,)) return diff --git a/melisa/listeners/guild_remove.py b/melisa/listeners/guild_remove.py index 6bac71a..8ff899d 100644 --- a/melisa/listeners/guild_remove.py +++ b/melisa/listeners/guild_remove.py @@ -15,7 +15,7 @@ async def guild_delete_listener(self, gateway, payload: dict): self.cache.remove_guild(guild.id) - await self.dispatch("on_guild_remove", (guild, )) + await self.dispatch("on_guild_remove", (guild,)) return diff --git a/melisa/listeners/message_create.py b/melisa/listeners/message_create.py index 6a492c7..994b453 100644 --- a/melisa/listeners/message_create.py +++ b/melisa/listeners/message_create.py @@ -9,7 +9,7 @@ from ..utils.types import Coro async def message_create_listener(self, gateway, payload: dict): message = Message.from_dict(payload) - await self.dispatch("on_message_create", (message, )) + await self.dispatch("on_message_create", (message,)) return diff --git a/melisa/listeners/ready.py b/melisa/listeners/ready.py index 7c20f61..71ddd47 100644 --- a/melisa/listeners/ready.py +++ b/melisa/listeners/ready.py @@ -16,7 +16,7 @@ async def on_ready_listener(self, gateway, payload: dict): self.user = User.from_dict(payload.get("user")) - await self.dispatch("on_shard_ready", (gateway.shard_id, )) + await self.dispatch("on_shard_ready", (gateway.shard_id,)) return diff --git a/melisa/models/app/cache.py b/melisa/models/app/cache.py index 88252d2..9bd34f7 100644 --- a/melisa/models/app/cache.py +++ b/melisa/models/app/cache.py @@ -31,7 +31,7 @@ class CacheManager: self, *, auto_models: Optional[List[AutoCacheModels]] = None, - auto_unused_attributes: Optional[Dict[Any, List[str]]] = None + auto_unused_attributes: Optional[Dict[Any, List[str]]] = None, ): self._auto_models: List[AutoCacheModels] = ( [] if auto_models is None else auto_models @@ -98,7 +98,7 @@ class CacheManager: if hasattr(guild, "channels"): channels = guild.channels.values() - if not AutoCacheModels.TEXT_CHANNELS in self._auto_models: + if AutoCacheModels.TEXT_CHANNELS not in self._auto_models: channels = filter( lambda channel: channel.type != ChannelType.GUILD_TEXT, channels ) @@ -137,7 +137,9 @@ class CacheManager: Data of guilds tso insert to the cache """ - guilds_dict = dict(map(lambda i: (i["id"], UnavailableGuild.from_dict(i)), guilds)) + guilds_dict = dict( + map(lambda i: (i["id"], UnavailableGuild.from_dict(i)), guilds) + ) self._raw_guilds.update(guilds_dict) return None