aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-08-12 00:30:50 -0400
committerRapptz <[email protected]>2021-08-12 00:30:50 -0400
commit1e17b7fceaf7173b1666465e639d1bebaa126683 (patch)
treec76411aad8f69107fb7bea978ccaae2452ca354d
parentFix incorrect indent (diff)
downloaddiscord.py-1e17b7fceaf7173b1666465e639d1bebaa126683.tar.xz
discord.py-1e17b7fceaf7173b1666465e639d1bebaa126683.zip
Rename start_thread to create_thread for consistency
-rw-r--r--discord/channel.py20
-rw-r--r--discord/message.py12
2 files changed, 16 insertions, 16 deletions
diff --git a/discord/channel.py b/discord/channel.py
index 6efd19d1..c859103a 100644
--- a/discord/channel.py
+++ b/discord/channel.py
@@ -657,7 +657,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
"""
return self.guild.get_thread(thread_id)
- async def start_thread(
+ async def create_thread(
self,
*,
name: str,
@@ -668,17 +668,17 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
) -> 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 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
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 d752c8c7..6f7bfd9a 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -1476,13 +1476,13 @@ class Message(Hashable):
"""
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 @@ class Message(Hashable):
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.')