mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-07 10:22:59 +00:00
Update comments after # type: ignore
to be compatible with PEP 484
This commit is contained in:
@ -375,7 +375,7 @@ class PartialMessageConverter(Converter[discord.PartialMessage]):
|
||||
guild_id, message_id, channel_id = self._get_id_matches(ctx, argument)
|
||||
channel = self._resolve_channel(ctx, guild_id, channel_id)
|
||||
if not channel or not isinstance(channel, discord.abc.Messageable):
|
||||
raise ChannelNotFound(channel_id) # type: ignore - channel_id won't be None here
|
||||
raise ChannelNotFound(channel_id) # type: ignore # channel_id won't be None here
|
||||
return discord.PartialMessage(channel=channel, id=message_id)
|
||||
|
||||
|
||||
@ -407,7 +407,7 @@ class MessageConverter(IDConverter[discord.Message]):
|
||||
except discord.NotFound:
|
||||
raise MessageNotFound(argument)
|
||||
except discord.Forbidden:
|
||||
raise ChannelNotReadable(channel) # type: ignore - type-checker thinks channel could be a DMChannel at this point
|
||||
raise ChannelNotReadable(channel) # type: ignore # type-checker thinks channel could be a DMChannel at this point
|
||||
|
||||
|
||||
class GuildChannelConverter(IDConverter[discord.abc.GuildChannel]):
|
||||
|
@ -1622,7 +1622,7 @@ def command(
|
||||
[
|
||||
Union[
|
||||
Callable[Concatenate[ContextT, P], Coro[Any]],
|
||||
Callable[Concatenate[CogT, ContextT, P], Coro[Any]], # type: ignore - CogT is used here to allow covariance
|
||||
Callable[Concatenate[CogT, ContextT, P], Coro[Any]], # type: ignore # CogT is used here to allow covariance
|
||||
]
|
||||
],
|
||||
CommandT,
|
||||
@ -1691,7 +1691,7 @@ def group(
|
||||
) -> Callable[
|
||||
[
|
||||
Union[
|
||||
Callable[Concatenate[CogT, ContextT, P], Coro[Any]], # type: ignore - CogT is used here to allow covariance
|
||||
Callable[Concatenate[CogT, ContextT, P], Coro[Any]], # type: ignore # CogT is used here to allow covariance
|
||||
Callable[Concatenate[ContextT, P], Coro[Any]],
|
||||
]
|
||||
],
|
||||
|
@ -361,7 +361,7 @@ class HelpCommand(HelpCommandCommand, Generic[ContextT]):
|
||||
The signature for the command.
|
||||
"""
|
||||
|
||||
parent: Optional[Group[Any, ..., Any]] = command.parent # type: ignore - the parent will be a Group
|
||||
parent: Optional[Group[Any, ..., Any]] = command.parent # type: ignore # the parent will be a Group
|
||||
entries = []
|
||||
while parent is not None:
|
||||
if not parent.signature or parent.invoke_without_command:
|
||||
@ -561,7 +561,7 @@ class HelpCommand(HelpCommandCommand, Generic[ContextT]):
|
||||
if self.verify_checks is False:
|
||||
# if we do not need to verify the checks then we can just
|
||||
# run it straight through normally without using await.
|
||||
return sorted(iterator, key=key) if sort else list(iterator) # type: ignore - the key shouldn't be None
|
||||
return sorted(iterator, key=key) if sort else list(iterator) # type: ignore # the key shouldn't be None
|
||||
|
||||
if self.verify_checks is None and not self.context.guild:
|
||||
# if verify_checks is None and we're in a DM, don't verify
|
||||
|
@ -181,7 +181,7 @@ class StringView:
|
||||
next_char = self.get()
|
||||
valid_eof = not next_char or next_char.isspace()
|
||||
if not valid_eof:
|
||||
raise InvalidEndOfQuotedStringError(next_char) # type: ignore - this will always be a string
|
||||
raise InvalidEndOfQuotedStringError(next_char) # type: ignore # this will always be a string
|
||||
|
||||
# we're quoted so it's okay
|
||||
return ''.join(result)
|
||||
|
Reference in New Issue
Block a user