From 1e17b7fceaf7173b1666465e639d1bebaa126683 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 12 Aug 2021 00:30:50 -0400 Subject: [PATCH] Rename start_thread to create_thread for consistency --- discord/channel.py | 20 ++++++++++---------- discord/message.py | 12 ++++++------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/discord/channel.py b/discord/channel.py index 6efd19d1820d..c859103add0c 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -657,7 +657,7 @@ def get_thread(self, thread_id: int, /) -> Optional[Thread]: """ return self.guild.get_thread(thread_id) - async def start_thread( + async def create_thread( self, *, name: str, @@ -668,17 +668,17 @@ async def start_thread( ) -> Thread: """|coro| - Starts a thread in this text channel. + Creates a thread in this text channel. If no starter message is passed with the ``message`` parameter then you must have :attr:`~discord.Permissions.send_messages` and - :attr:`~discord.Permissions.use_private_threads` in order to start the thread + :attr:`~discord.Permissions.use_private_threads` in order to create the thread if the ``type`` parameter is :attr:`~discord.ChannelType.private_thread`. Otherwise :attr:`~discord.Permissions.use_threads` is needed. If a starter message is passed with the ``message`` parameter then you must have :attr:`~discord.Permissions.send_messages` and - :attr:`~discord.Permissions.use_threads` in order to start the thread. + :attr:`~discord.Permissions.use_threads` in order to create the thread. .. versionadded:: 2.0 @@ -687,30 +687,30 @@ async def start_thread( name: :class:`str` The name of the thread. message: Optional[:class:`abc.Snowflake`] - A snowflake representing the message to start the thread with. - If ``None`` is passed then a private thread is started. + A snowflake representing the message to create the thread with. + If ``None`` is passed then a private thread is created. Defaults to ``None``. auto_archive_duration: :class:`int` The duration in minutes before a thread is automatically archived for inactivity. Defaults to ``1440`` or 24 hours. type: Optional[:class:`ChannelType`] The type of thread to create. If a ``message`` is passed then this parameter - is ignored, as a thread started with a message is always a public thread. + is ignored, as a thread created with a message is always a public thread. By default this creates a private thread if this is ``None``. reason: :class:`str` - The reason for starting a new thread. Shows up on the audit log. + The reason for creating a new thread. Shows up on the audit log. Raises ------- Forbidden - You do not have permissions to start a thread. + You do not have permissions to create a thread. HTTPException Starting the thread failed. Returns -------- :class:`Thread` - The started thread + The created thread """ if type is None: diff --git a/discord/message.py b/discord/message.py index d752c8c717ba..6f7bfd9a0594 100644 --- a/discord/message.py +++ b/discord/message.py @@ -1476,13 +1476,13 @@ async def clear_reactions(self) -> None: """ await self._state.http.clear_reactions(self.channel.id, self.id) - async def start_thread(self, *, name: str, auto_archive_duration: ThreadArchiveDuration = 1440) -> Thread: + async def create_thread(self, *, name: str, auto_archive_duration: ThreadArchiveDuration = 1440) -> Thread: """|coro| - Starts a public thread from this message. + Creates a public thread from this message. You must have :attr:`~discord.Permissions.send_messages` and - :attr:`~discord.Permissions.use_threads` in order to start a thread. + :attr:`~discord.Permissions.use_threads` in order to create a thread. The channel this message belongs in must be a :class:`TextChannel`. @@ -1497,16 +1497,16 @@ async def start_thread(self, *, name: str, auto_archive_duration: ThreadArchiveD Raises ------- Forbidden - You do not have permissions to start a thread. + You do not have permissions to create a thread. HTTPException - Starting the thread failed. + Creating the thread failed. InvalidArgument This message does not have guild info attached. Returns -------- :class:`.Thread` - The started thread. + The created thread. """ if self.guild is None: raise InvalidArgument('This message does not have guild info attached.')