From 6c420652108028bf527ab81bf76c5c39706affca Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 4 Aug 2022 08:17:07 -0400 Subject: [PATCH] Fix various a -> an typos across the library Closes #8301, #8287 --- discord/app_commands/models.py | 4 ++-- discord/app_commands/transformers.py | 2 +- discord/app_commands/tree.py | 6 +++--- discord/ext/commands/core.py | 2 +- discord/flags.py | 16 ++++++++-------- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/discord/app_commands/models.py b/discord/app_commands/models.py index cb9065018..494031d45 100644 --- a/discord/app_commands/models.py +++ b/discord/app_commands/models.py @@ -108,7 +108,7 @@ class AllChannels: class AppCommand(Hashable): - """Represents a application command. + """Represents an application command. In common parlance this is referred to as a "Slash Command" or a "Context Menu Command". @@ -732,7 +732,7 @@ class AppCommandThread(Hashable): class Argument: - """Represents a application command argument. + """Represents an application command argument. .. versionadded:: 2.0 diff --git a/discord/app_commands/transformers.py b/discord/app_commands/transformers.py index 994714dae..a304df546 100644 --- a/discord/app_commands/transformers.py +++ b/discord/app_commands/transformers.py @@ -73,7 +73,7 @@ if TYPE_CHECKING: @dataclass class CommandParameter: - """Represents a application command parameter. + """Represents an application command parameter. Attributes ----------- diff --git a/discord/app_commands/tree.py b/discord/app_commands/tree.py index 5f20060cb..e24885d67 100644 --- a/discord/app_commands/tree.py +++ b/discord/app_commands/tree.py @@ -344,7 +344,7 @@ class CommandTree(Generic[ClientT]): self._context_menus.update(current) return elif not isinstance(command, (Command, Group)): - raise TypeError(f'Expected a application command, received {command.__class__!r} instead') + raise TypeError(f'Expected an application command, received {command.__class__!r} instead') # todo: validate application command groups having children (required) @@ -538,7 +538,7 @@ class CommandTree(Generic[ClientT]): guild: Optional[Snowflake] = None, type: AppCommandType = AppCommandType.chat_input, ) -> Optional[Union[Command[Any, ..., Any], ContextMenu, Group]]: - """Gets a application command from the tree. + """Gets an application command from the tree. Parameters ----------- @@ -900,7 +900,7 @@ class CommandTree(Generic[ClientT]): guilds: Sequence[Snowflake] = MISSING, extras: Dict[Any, Any] = MISSING, ) -> Callable[[ContextMenuCallback], ContextMenu]: - """Creates a application command context menu from a regular function directly under this tree. + """Creates an application command context menu from a regular function directly under this tree. This function must have a signature of :class:`~discord.Interaction` as its first parameter and taking either a :class:`~discord.Member`, :class:`~discord.User`, or :class:`~discord.Message`, diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 68b0f0950..7b08d7103 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -406,7 +406,7 @@ class Command(_BaseCommand, Generic[CogT, P, T]): elif isinstance(cooldown, CooldownMapping): buckets: CooldownMapping[Context[Any]] = cooldown else: - raise TypeError("Cooldown must be a an instance of CooldownMapping or None.") + raise TypeError("Cooldown must be an instance of CooldownMapping or None.") self._buckets: CooldownMapping[Context[Any]] = buckets try: diff --git a/discord/flags.py b/discord/flags.py index 47674ab75..1c2a3046e 100644 --- a/discord/flags.py +++ b/discord/flags.py @@ -1322,28 +1322,28 @@ class ApplicationFlags(BaseFlags): .. describe:: x | y, x |= y - Returns a ApplicationFlags instance with all enabled flags from + Returns an ApplicationFlags instance with all enabled flags from both x and y. .. versionadded:: 2.0 .. describe:: x & y, x &= y - Returns a ApplicationFlags instance with only flags enabled on + Returns an ApplicationFlags instance with only flags enabled on both x and y. .. versionadded:: 2.0 .. describe:: x ^ y, x ^= y - Returns a ApplicationFlags instance with only flags enabled on + Returns an ApplicationFlags instance with only flags enabled on only one of x or y, not on both. .. versionadded:: 2.0 .. describe:: ~x - Returns a ApplicationFlags instance with all flags inverted from x. + Returns an ApplicationFlags instance with all flags inverted from x. .. versionadded:: 2.0 @@ -1518,28 +1518,28 @@ class AutoModPresets(ArrayFlags): .. describe:: x | y, x |= y - Returns a AutoModPresets instance with all enabled flags from + Returns an AutoModPresets instance with all enabled flags from both x and y. .. versionadded:: 2.0 .. describe:: x & y, x &= y - Returns a AutoModPresets instance with only flags enabled on + Returns an AutoModPresets instance with only flags enabled on both x and y. .. versionadded:: 2.0 .. describe:: x ^ y, x ^= y - Returns a AutoModPresets instance with only flags enabled on + Returns an AutoModPresets instance with only flags enabled on only one of x or y, not on both. .. versionadded:: 2.0 .. describe:: ~x - Returns a AutoModPresets instance with all flags inverted from x. + Returns an AutoModPresets instance with all flags inverted from x. .. versionadded:: 2.0