mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-20 18:06:47 +00:00
Rename start_thread to create_thread for consistency
This commit is contained in:
parent
fda543c844
commit
1e17b7fcea
@ -657,7 +657,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
|
|||||||
"""
|
"""
|
||||||
return self.guild.get_thread(thread_id)
|
return self.guild.get_thread(thread_id)
|
||||||
|
|
||||||
async def start_thread(
|
async def create_thread(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
name: str,
|
name: str,
|
||||||
@ -668,17 +668,17 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
|
|||||||
) -> Thread:
|
) -> Thread:
|
||||||
"""|coro|
|
"""|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
|
If no starter message is passed with the ``message`` parameter then
|
||||||
you must have :attr:`~discord.Permissions.send_messages` and
|
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`.
|
if the ``type`` parameter is :attr:`~discord.ChannelType.private_thread`.
|
||||||
Otherwise :attr:`~discord.Permissions.use_threads` is needed.
|
Otherwise :attr:`~discord.Permissions.use_threads` is needed.
|
||||||
|
|
||||||
If a starter message is passed with the ``message`` parameter then
|
If a starter message is passed with the ``message`` parameter then
|
||||||
you must have :attr:`~discord.Permissions.send_messages` and
|
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
|
.. versionadded:: 2.0
|
||||||
|
|
||||||
@ -687,30 +687,30 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
|
|||||||
name: :class:`str`
|
name: :class:`str`
|
||||||
The name of the thread.
|
The name of the thread.
|
||||||
message: Optional[:class:`abc.Snowflake`]
|
message: Optional[:class:`abc.Snowflake`]
|
||||||
A snowflake representing the message to start the thread with.
|
A snowflake representing the message to create the thread with.
|
||||||
If ``None`` is passed then a private thread is started.
|
If ``None`` is passed then a private thread is created.
|
||||||
Defaults to ``None``.
|
Defaults to ``None``.
|
||||||
auto_archive_duration: :class:`int`
|
auto_archive_duration: :class:`int`
|
||||||
The duration in minutes before a thread is automatically archived for inactivity.
|
The duration in minutes before a thread is automatically archived for inactivity.
|
||||||
Defaults to ``1440`` or 24 hours.
|
Defaults to ``1440`` or 24 hours.
|
||||||
type: Optional[:class:`ChannelType`]
|
type: Optional[:class:`ChannelType`]
|
||||||
The type of thread to create. If a ``message`` is passed then this parameter
|
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``.
|
By default this creates a private thread if this is ``None``.
|
||||||
reason: :class:`str`
|
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
|
Raises
|
||||||
-------
|
-------
|
||||||
Forbidden
|
Forbidden
|
||||||
You do not have permissions to start a thread.
|
You do not have permissions to create a thread.
|
||||||
HTTPException
|
HTTPException
|
||||||
Starting the thread failed.
|
Starting the thread failed.
|
||||||
|
|
||||||
Returns
|
Returns
|
||||||
--------
|
--------
|
||||||
:class:`Thread`
|
:class:`Thread`
|
||||||
The started thread
|
The created thread
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if type is None:
|
if type is None:
|
||||||
|
@ -1476,13 +1476,13 @@ class Message(Hashable):
|
|||||||
"""
|
"""
|
||||||
await self._state.http.clear_reactions(self.channel.id, self.id)
|
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|
|
"""|coro|
|
||||||
|
|
||||||
Starts a public thread from this message.
|
Creates a public thread from this message.
|
||||||
|
|
||||||
You must have :attr:`~discord.Permissions.send_messages` and
|
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`.
|
The channel this message belongs in must be a :class:`TextChannel`.
|
||||||
|
|
||||||
@ -1497,16 +1497,16 @@ class Message(Hashable):
|
|||||||
Raises
|
Raises
|
||||||
-------
|
-------
|
||||||
Forbidden
|
Forbidden
|
||||||
You do not have permissions to start a thread.
|
You do not have permissions to create a thread.
|
||||||
HTTPException
|
HTTPException
|
||||||
Starting the thread failed.
|
Creating the thread failed.
|
||||||
InvalidArgument
|
InvalidArgument
|
||||||
This message does not have guild info attached.
|
This message does not have guild info attached.
|
||||||
|
|
||||||
Returns
|
Returns
|
||||||
--------
|
--------
|
||||||
:class:`.Thread`
|
:class:`.Thread`
|
||||||
The started thread.
|
The created thread.
|
||||||
"""
|
"""
|
||||||
if self.guild is None:
|
if self.guild is None:
|
||||||
raise InvalidArgument('This message does not have guild info attached.')
|
raise InvalidArgument('This message does not have guild info attached.')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user