From c7c6d74d8d7447e075000049f216df7bf2707cc1 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 21 Feb 2022 22:38:36 -0500 Subject: [PATCH] Fix type errors in the abc module --- discord/abc.py | 8 ++++---- discord/http.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/discord/abc.py b/discord/abc.py index 8514181a3..9b66b33fd 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -255,7 +255,7 @@ class GuildChannel: if TYPE_CHECKING: - def __init__(self, *, state: ConnectionState, guild: Guild, data: Dict[str, Any]): + def __init__(self, *, state: ConnectionState, guild: Guild, data: GuildChannelPayload): ... def __str__(self) -> str: @@ -507,7 +507,7 @@ class GuildChannel: If there is no category then this is ``None``. """ - return self.guild.get_channel(self.category_id) # type: ignore + return self.guild.get_channel(self.category_id) # type: ignore - These are coerced into CategoryChannel @property def permissions_synced(self) -> bool: @@ -802,7 +802,7 @@ class GuildChannel: await http.delete_channel_permissions(self.id, target.id, reason=reason) elif isinstance(overwrite, PermissionOverwrite): (allow, deny) = overwrite.pair() - await http.edit_channel_permissions(self.id, target.id, allow.value, deny.value, perm_type, reason=reason) + await http.edit_channel_permissions(self.id, target.id, str(allow.value), str(deny.value), perm_type, reason=reason) else: raise InvalidArgument('Invalid overwrite type provided.') @@ -822,7 +822,7 @@ class GuildChannel: obj = cls(state=self._state, guild=self.guild, data=data) # temporarily add it to the cache - self.guild._channels[obj.id] = obj # type: ignore + self.guild._channels[obj.id] = obj # type: ignore - obj is a GuildChannel return obj async def clone(self: GCH, *, name: Optional[str] = None, reason: Optional[str] = None) -> GCH: diff --git a/discord/http.py b/discord/http.py index 005726a87..895de9b3b 100644 --- a/discord/http.py +++ b/discord/http.py @@ -1525,7 +1525,7 @@ class HTTPClient: return self.request(r, json=payload, reason=reason) def delete_channel_permissions( - self, channel_id: Snowflake, target: channel.OverwriteType, *, reason: Optional[str] = None + self, channel_id: Snowflake, target: Snowflake, *, reason: Optional[str] = None ) -> Response[None]: r = Route('DELETE', '/channels/{channel_id}/permissions/{target}', channel_id=channel_id, target=target) return self.request(r, reason=reason)