mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-07 02:21:54 +00:00
Fix type errors in the abc module
This commit is contained in:
parent
24b729ed0d
commit
c7c6d74d8d
@ -255,7 +255,7 @@ class GuildChannel:
|
|||||||
|
|
||||||
if TYPE_CHECKING:
|
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:
|
def __str__(self) -> str:
|
||||||
@ -507,7 +507,7 @@ class GuildChannel:
|
|||||||
|
|
||||||
If there is no category then this is ``None``.
|
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
|
@property
|
||||||
def permissions_synced(self) -> bool:
|
def permissions_synced(self) -> bool:
|
||||||
@ -802,7 +802,7 @@ class GuildChannel:
|
|||||||
await http.delete_channel_permissions(self.id, target.id, reason=reason)
|
await http.delete_channel_permissions(self.id, target.id, reason=reason)
|
||||||
elif isinstance(overwrite, PermissionOverwrite):
|
elif isinstance(overwrite, PermissionOverwrite):
|
||||||
(allow, deny) = overwrite.pair()
|
(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:
|
else:
|
||||||
raise InvalidArgument('Invalid overwrite type provided.')
|
raise InvalidArgument('Invalid overwrite type provided.')
|
||||||
|
|
||||||
@ -822,7 +822,7 @@ class GuildChannel:
|
|||||||
obj = cls(state=self._state, guild=self.guild, data=data)
|
obj = cls(state=self._state, guild=self.guild, data=data)
|
||||||
|
|
||||||
# temporarily add it to the cache
|
# 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
|
return obj
|
||||||
|
|
||||||
async def clone(self: GCH, *, name: Optional[str] = None, reason: Optional[str] = None) -> GCH:
|
async def clone(self: GCH, *, name: Optional[str] = None, reason: Optional[str] = None) -> GCH:
|
||||||
|
@ -1525,7 +1525,7 @@ class HTTPClient:
|
|||||||
return self.request(r, json=payload, reason=reason)
|
return self.request(r, json=payload, reason=reason)
|
||||||
|
|
||||||
def delete_channel_permissions(
|
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]:
|
) -> Response[None]:
|
||||||
r = Route('DELETE', '/channels/{channel_id}/permissions/{target}', channel_id=channel_id, target=target)
|
r = Route('DELETE', '/channels/{channel_id}/permissions/{target}', channel_id=channel_id, target=target)
|
||||||
return self.request(r, reason=reason)
|
return self.request(r, reason=reason)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user