From 9e31aad96daacfa2302e2af748e60da0891f39c9 Mon Sep 17 00:00:00 2001 From: Gnome Date: Thu, 7 Oct 2021 17:34:29 +0100 Subject: [PATCH] Fix code style issues with Black --- discord/ext/commands/bot.py | 2 +- discord/ext/commands/core.py | 4 +++- discord/ext/commands/errors.py | 2 +- discord/http.py | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index e2a91b19..3b97e1ee 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -122,7 +122,7 @@ class _FakeSlashMessage(discord.PartialMessage): def mentions(self) -> List[Union[discord.Member, discord.User]]: client = self._state._get_client() if self.guild: - ensure_user = lambda id: self.guild.get_member(id) or client.get_user(id) # type: ignore + ensure_user = lambda id: self.guild.get_member(id) or client.get_user(id) # type: ignore else: ensure_user = client.get_user diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 178b252e..9650bd6f 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -1694,7 +1694,9 @@ class Group(GroupMixin[CogT], Command[CogT, P, T]): "name": self.name, "type": int(not (nested - 1)) + 1, "description": self.short_doc or "no description", - "options": [cmd.to_application_command(nested=nested + 1) for cmd in sorted(self.commands, key=lambda x: x.name)], + "options": [ + cmd.to_application_command(nested=nested + 1) for cmd in sorted(self.commands, key=lambda x: x.name) + ], } diff --git a/discord/ext/commands/errors.py b/discord/ext/commands/errors.py index c8dde033..25162925 100644 --- a/discord/ext/commands/errors.py +++ b/discord/ext/commands/errors.py @@ -455,7 +455,7 @@ class BadInviteArgument(BadArgument): This inherits from :exc:`BadArgument` .. versionadded:: 1.5 - + Attributes ----------- argument: :class:`str` diff --git a/discord/http.py b/discord/http.py index e7a623d2..3fef633c 100644 --- a/discord/http.py +++ b/discord/http.py @@ -188,8 +188,8 @@ class HTTPClient: self.proxy_auth: Optional[aiohttp.BasicAuth] = proxy_auth self.use_clock: bool = not unsync_clock - user_agent = "DiscordBot (https://github.com/iDevision/enhanced-discord.py {0}) Python/{1[0]}.{1[1]} aiohttp/{2}" - self.user_agent: str = user_agent.format(__version__, sys.version_info, aiohttp.__version__) + u_agent = "DiscordBot (https://github.com/iDevision/enhanced-discord.py {0}) Python/{1[0]}.{1[1]} aiohttp/{2}" + self.user_agent: str = u_agent.format(__version__, sys.version_info, aiohttp.__version__) def recreate(self) -> None: if self.__session.closed: