mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-25 02:23:04 +00:00
Fix type annotations to adhere to latest pyright release
This commit is contained in:
@@ -771,8 +771,7 @@ class Command(Generic[GroupT, P, T]):
|
||||
if not predicates:
|
||||
return True
|
||||
|
||||
# Type checker does not understand negative narrowing cases like this function
|
||||
return await async_all(f(interaction) for f in predicates) # type: ignore
|
||||
return await async_all(f(interaction) for f in predicates)
|
||||
|
||||
def error(self, coro: Error[GroupT]) -> Error[GroupT]:
|
||||
"""A decorator that registers a coroutine as a local error handler.
|
||||
@@ -997,8 +996,7 @@ class ContextMenu:
|
||||
if not predicates:
|
||||
return True
|
||||
|
||||
# Type checker does not understand negative narrowing cases like this function
|
||||
return await async_all(f(interaction) for f in predicates) # type: ignore
|
||||
return await async_all(f(interaction) for f in predicates)
|
||||
|
||||
def _has_any_error_handlers(self) -> bool:
|
||||
return self.on_error is not None
|
||||
|
||||
@@ -96,14 +96,14 @@ class AllChannels:
|
||||
__slots__ = ('guild',)
|
||||
|
||||
def __init__(self, guild: Guild):
|
||||
self.guild = guild
|
||||
self.guild: Guild = guild
|
||||
|
||||
@property
|
||||
def id(self) -> int:
|
||||
""":class:`int`: The ID sentinel used to represent all channels. Equivalent to the guild's ID minus 1."""
|
||||
return self.guild.id - 1
|
||||
|
||||
def __repr__(self):
|
||||
def __repr__(self) -> str:
|
||||
return f'<AllChannels guild={self.guild}>'
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user