From 3ffd0b073bca1cafd66e5376bae5da8d2763e02a Mon Sep 17 00:00:00 2001 From: dolfies Date: Fri, 3 Feb 2023 21:48:42 -0500 Subject: [PATCH] Normalize include_applications -> with_applications --- discord/abc.py | 22 +++++++++++----------- discord/ext/commands/context.py | 4 ++-- discord/message.py | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/discord/abc.py b/discord/abc.py index f762f8ec2..d2da75684 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -155,7 +155,7 @@ def _handle_commands( limit: Optional[int] = ..., command_ids: Optional[List[int]] = ..., application: Optional[Snowflake] = ..., - include_applications: bool = ..., + with_applications: bool = ..., target: Optional[Snowflake] = ..., ) -> AsyncIterator[SlashCommand]: ... @@ -170,7 +170,7 @@ def _handle_commands( limit: Optional[int] = ..., command_ids: Optional[List[int]] = ..., application: Optional[Snowflake] = ..., - include_applications: bool = ..., + with_applications: bool = ..., target: Optional[Snowflake] = ..., ) -> AsyncIterator[UserCommand]: ... @@ -185,7 +185,7 @@ def _handle_commands( limit: Optional[int] = ..., command_ids: Optional[List[int]] = ..., application: Optional[Snowflake] = ..., - include_applications: bool = ..., + with_applications: bool = ..., target: Optional[Snowflake] = ..., ) -> AsyncIterator[MessageCommand]: ... @@ -199,7 +199,7 @@ async def _handle_commands( limit: Optional[int] = None, command_ids: Optional[List[int]] = None, application: Optional[Snowflake] = None, - include_applications: bool = True, + with_applications: bool = True, target: Optional[Snowflake] = None, ) -> AsyncIterator[BaseCommand]: if limit is not None and limit < 0: @@ -240,7 +240,7 @@ async def _handle_commands( query=query if not command_ids and not application_id else None, command_ids=command_ids if not application_id and not cursor else None, # type: ignore application_id=application_id, - include_applications=include_applications if (not application_id or include_applications) else None, + include_applications=with_applications if (not application_id or with_applications) else None, cursor=cursor, ) prev_cursor = cursor @@ -1868,7 +1868,7 @@ class Messageable: limit: Optional[int] = None, command_ids: Optional[List[int]] = None, application: Optional[Snowflake] = None, - include_applications: bool = True, + with_applications: bool = True, ) -> AsyncIterator[SlashCommand]: """Returns a :term:`asynchronous iterator` of the slash commands available in the channel. @@ -1905,7 +1905,7 @@ class Messageable: This means that the endpoint will return the found commands + up to ``limit`` more, if available. application: Optional[:class:`~discord.abc.Snowflake`] Whether to return this application's commands. Always set to DM recipient in a private channel context. - include_applications: :class:`bool` + with_applications: :class:`bool` Whether to include applications in the response. Defaults to ``True``. Raises @@ -1934,7 +1934,7 @@ class Messageable: limit=limit, command_ids=command_ids, application=application, - include_applications=include_applications, + with_applications=with_applications, ) def user_commands( @@ -1944,7 +1944,7 @@ class Messageable: limit: Optional[int] = None, command_ids: Optional[List[int]] = None, application: Optional[Snowflake] = None, - include_applications: bool = True, + with_applications: bool = True, ) -> AsyncIterator[UserCommand]: """Returns a :term:`asynchronous iterator` of the user commands available to use on the user. @@ -1981,7 +1981,7 @@ class Messageable: This means that the endpoint will return the found commands + up to ``limit`` more, if available. application: Optional[:class:`~discord.abc.Snowflake`] Whether to return this application's commands. Always set to DM recipient in a private channel context. - include_applications: :class:`bool` + with_applications: :class:`bool` Whether to include applications in the response. Defaults to ``True``. Raises @@ -2010,7 +2010,7 @@ class Messageable: limit=limit, command_ids=command_ids, application=application, - include_applications=include_applications, + with_applications=with_applications, ) diff --git a/discord/ext/commands/context.py b/discord/ext/commands/context.py index e93b386ae..59b509148 100644 --- a/discord/ext/commands/context.py +++ b/discord/ext/commands/context.py @@ -419,8 +419,8 @@ class Context(discord.abc.Messageable, Generic[BotT]): limit: Optional[int] = None, command_ids: Optional[List[int]] = None, application: Optional[discord.abc.Snowflake] = None, - include_applications: bool = True, + with_applications: bool = True, ) -> AsyncIterator[MessageCommand]: return self.message.message_commands( - query, limit=limit, command_ids=command_ids, include_applications=include_applications, application=application + query, limit=limit, command_ids=command_ids, with_applications=with_applications, application=application ) diff --git a/discord/message.py b/discord/message.py index e8911c416..9373bc9bc 100644 --- a/discord/message.py +++ b/discord/message.py @@ -1991,7 +1991,7 @@ class Message(PartialMessage, Hashable): limit: Optional[int] = None, command_ids: Optional[List[int]] = None, application: Optional[Snowflake] = None, - include_applications: bool = True, + with_applications: bool = True, ) -> AsyncIterator[MessageCommand]: """Returns a :term:`asynchronous iterator` of the message commands available to use on the message. @@ -2028,7 +2028,7 @@ class Message(PartialMessage, Hashable): This means that the endpoint will return the found commands + up to ``limit`` more, if available. application: Optional[:class:`~discord.abc.Snowflake`] Whether to return this application's commands. Always set to DM recipient in a private channel context. - include_applications: :class:`bool` + with_applications: :class:`bool` Whether to include applications in the response. Defaults to ``True``. Raises @@ -2057,6 +2057,6 @@ class Message(PartialMessage, Hashable): limit=limit, command_ids=command_ids, application=application, - include_applications=include_applications, + with_applications=with_applications, target=self, )