Browse Source

Normalize include_applications -> with_applications

pull/10109/head
dolfies 2 years ago
parent
commit
3ffd0b073b
  1. 22
      discord/abc.py
  2. 4
      discord/ext/commands/context.py
  3. 6
      discord/message.py

22
discord/abc.py

@ -155,7 +155,7 @@ def _handle_commands(
limit: Optional[int] = ..., limit: Optional[int] = ...,
command_ids: Optional[List[int]] = ..., command_ids: Optional[List[int]] = ...,
application: Optional[Snowflake] = ..., application: Optional[Snowflake] = ...,
include_applications: bool = ..., with_applications: bool = ...,
target: Optional[Snowflake] = ..., target: Optional[Snowflake] = ...,
) -> AsyncIterator[SlashCommand]: ) -> AsyncIterator[SlashCommand]:
... ...
@ -170,7 +170,7 @@ def _handle_commands(
limit: Optional[int] = ..., limit: Optional[int] = ...,
command_ids: Optional[List[int]] = ..., command_ids: Optional[List[int]] = ...,
application: Optional[Snowflake] = ..., application: Optional[Snowflake] = ...,
include_applications: bool = ..., with_applications: bool = ...,
target: Optional[Snowflake] = ..., target: Optional[Snowflake] = ...,
) -> AsyncIterator[UserCommand]: ) -> AsyncIterator[UserCommand]:
... ...
@ -185,7 +185,7 @@ def _handle_commands(
limit: Optional[int] = ..., limit: Optional[int] = ...,
command_ids: Optional[List[int]] = ..., command_ids: Optional[List[int]] = ...,
application: Optional[Snowflake] = ..., application: Optional[Snowflake] = ...,
include_applications: bool = ..., with_applications: bool = ...,
target: Optional[Snowflake] = ..., target: Optional[Snowflake] = ...,
) -> AsyncIterator[MessageCommand]: ) -> AsyncIterator[MessageCommand]:
... ...
@ -199,7 +199,7 @@ async def _handle_commands(
limit: Optional[int] = None, limit: Optional[int] = None,
command_ids: Optional[List[int]] = None, command_ids: Optional[List[int]] = None,
application: Optional[Snowflake] = None, application: Optional[Snowflake] = None,
include_applications: bool = True, with_applications: bool = True,
target: Optional[Snowflake] = None, target: Optional[Snowflake] = None,
) -> AsyncIterator[BaseCommand]: ) -> AsyncIterator[BaseCommand]:
if limit is not None and limit < 0: 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, 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 command_ids=command_ids if not application_id and not cursor else None, # type: ignore
application_id=application_id, 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, cursor=cursor,
) )
prev_cursor = cursor prev_cursor = cursor
@ -1868,7 +1868,7 @@ class Messageable:
limit: Optional[int] = None, limit: Optional[int] = None,
command_ids: Optional[List[int]] = None, command_ids: Optional[List[int]] = None,
application: Optional[Snowflake] = None, application: Optional[Snowflake] = None,
include_applications: bool = True, with_applications: bool = True,
) -> AsyncIterator[SlashCommand]: ) -> AsyncIterator[SlashCommand]:
"""Returns a :term:`asynchronous iterator` of the slash commands available in the channel. """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. This means that the endpoint will return the found commands + up to ``limit`` more, if available.
application: Optional[:class:`~discord.abc.Snowflake`] application: Optional[:class:`~discord.abc.Snowflake`]
Whether to return this application's commands. Always set to DM recipient in a private channel context. 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``. Whether to include applications in the response. Defaults to ``True``.
Raises Raises
@ -1934,7 +1934,7 @@ class Messageable:
limit=limit, limit=limit,
command_ids=command_ids, command_ids=command_ids,
application=application, application=application,
include_applications=include_applications, with_applications=with_applications,
) )
def user_commands( def user_commands(
@ -1944,7 +1944,7 @@ class Messageable:
limit: Optional[int] = None, limit: Optional[int] = None,
command_ids: Optional[List[int]] = None, command_ids: Optional[List[int]] = None,
application: Optional[Snowflake] = None, application: Optional[Snowflake] = None,
include_applications: bool = True, with_applications: bool = True,
) -> AsyncIterator[UserCommand]: ) -> AsyncIterator[UserCommand]:
"""Returns a :term:`asynchronous iterator` of the user commands available to use on the user. """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. This means that the endpoint will return the found commands + up to ``limit`` more, if available.
application: Optional[:class:`~discord.abc.Snowflake`] application: Optional[:class:`~discord.abc.Snowflake`]
Whether to return this application's commands. Always set to DM recipient in a private channel context. 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``. Whether to include applications in the response. Defaults to ``True``.
Raises Raises
@ -2010,7 +2010,7 @@ class Messageable:
limit=limit, limit=limit,
command_ids=command_ids, command_ids=command_ids,
application=application, application=application,
include_applications=include_applications, with_applications=with_applications,
) )

4
discord/ext/commands/context.py

@ -419,8 +419,8 @@ class Context(discord.abc.Messageable, Generic[BotT]):
limit: Optional[int] = None, limit: Optional[int] = None,
command_ids: Optional[List[int]] = None, command_ids: Optional[List[int]] = None,
application: Optional[discord.abc.Snowflake] = None, application: Optional[discord.abc.Snowflake] = None,
include_applications: bool = True, with_applications: bool = True,
) -> AsyncIterator[MessageCommand]: ) -> AsyncIterator[MessageCommand]:
return self.message.message_commands( 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
) )

6
discord/message.py

@ -1991,7 +1991,7 @@ class Message(PartialMessage, Hashable):
limit: Optional[int] = None, limit: Optional[int] = None,
command_ids: Optional[List[int]] = None, command_ids: Optional[List[int]] = None,
application: Optional[Snowflake] = None, application: Optional[Snowflake] = None,
include_applications: bool = True, with_applications: bool = True,
) -> AsyncIterator[MessageCommand]: ) -> AsyncIterator[MessageCommand]:
"""Returns a :term:`asynchronous iterator` of the message commands available to use on the message. """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. This means that the endpoint will return the found commands + up to ``limit`` more, if available.
application: Optional[:class:`~discord.abc.Snowflake`] application: Optional[:class:`~discord.abc.Snowflake`]
Whether to return this application's commands. Always set to DM recipient in a private channel context. 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``. Whether to include applications in the response. Defaults to ``True``.
Raises Raises
@ -2057,6 +2057,6 @@ class Message(PartialMessage, Hashable):
limit=limit, limit=limit,
command_ids=command_ids, command_ids=command_ids,
application=application, application=application,
include_applications=include_applications, with_applications=with_applications,
target=self, target=self,
) )

Loading…
Cancel
Save