From c1f93b96adfe463e33c0d2bf98d5b28e97e90675 Mon Sep 17 00:00:00 2001 From: Krittick Date: Thu, 5 May 2022 16:24:28 -0700 Subject: [PATCH] apply code style fixes --- discord/commands/permissions.py | 1 + discord/enums.py | 5 ++++- discord/http.py | 6 +++--- discord/state.py | 1 - 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/discord/commands/permissions.py b/discord/commands/permissions.py index 49f3a08901..dc5b34a2d4 100644 --- a/discord/commands/permissions.py +++ b/discord/commands/permissions.py @@ -24,6 +24,7 @@ """ from typing import Callable, Dict, Union + from ..permissions import Permissions from .core import ApplicationCommand diff --git a/discord/enums.py b/discord/enums.py index 9066b77d7a..9920d70a86 100644 --- a/discord/enums.py +++ b/discord/enums.py @@ -700,8 +700,11 @@ def from_datatype(cls, datatype): return cls.number from .commands.context import ApplicationContext + if not issubclass(datatype, ApplicationContext): # TODO: prevent ctx being passed here in cog commands - raise TypeError(f"Invalid class {datatype} used as an input type for an Option") # TODO: Improve the error message + raise TypeError( + f"Invalid class {datatype} used as an input type for an Option" + ) # TODO: Improve the error message class EmbeddedActivity(Enum): diff --git a/discord/http.py b/discord/http.py index 8d8dae8697..e0b5352c09 100644 --- a/discord/http.py +++ b/discord/http.py @@ -2240,7 +2240,7 @@ def bulk_upsert_guild_commands( return self.request(r, json=payload) # Application commands (permissions) - + def get_command_permissions( self, application_id: Snowflake, @@ -2254,7 +2254,7 @@ def get_command_permissions( guild_id=guild_id, ) return self.request(r) - + def get_guild_command_permissions( self, application_id: Snowflake, @@ -2267,7 +2267,7 @@ def get_guild_command_permissions( guild_id=guild_id, ) return self.request(r) - + # Interaction responses def _edit_webhook_helper( diff --git a/discord/state.py b/discord/state.py index 0226351e73..c1571d9255 100644 --- a/discord/state.py +++ b/discord/state.py @@ -1576,7 +1576,6 @@ def parse_voice_state_update(self, data) -> None: coro = voice.on_voice_state_update(data) asyncio.create_task(logging_coroutine(coro, info="Voice Protocol voice state update handler")) - def parse_voice_server_update(self, data) -> None: try: key_id = int(data["guild_id"])