mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-18 04:00:39 +00:00
Add silent parameter to ForumChannel.create_thread
This commit is contained in:
@@ -2879,6 +2879,7 @@ class ForumChannel(discord.abc.GuildChannel, Hashable):
|
|||||||
applied_tags: Sequence[ForumTag] = ...,
|
applied_tags: Sequence[ForumTag] = ...,
|
||||||
view: LayoutView,
|
view: LayoutView,
|
||||||
suppress_embeds: bool = ...,
|
suppress_embeds: bool = ...,
|
||||||
|
silent: bool = ...,
|
||||||
reason: Optional[str] = ...,
|
reason: Optional[str] = ...,
|
||||||
) -> ThreadWithMessage: ...
|
) -> ThreadWithMessage: ...
|
||||||
|
|
||||||
@@ -2901,6 +2902,7 @@ class ForumChannel(discord.abc.GuildChannel, Hashable):
|
|||||||
applied_tags: Sequence[ForumTag] = ...,
|
applied_tags: Sequence[ForumTag] = ...,
|
||||||
view: View = ...,
|
view: View = ...,
|
||||||
suppress_embeds: bool = ...,
|
suppress_embeds: bool = ...,
|
||||||
|
silent: bool = ...,
|
||||||
reason: Optional[str] = ...,
|
reason: Optional[str] = ...,
|
||||||
) -> ThreadWithMessage: ...
|
) -> ThreadWithMessage: ...
|
||||||
|
|
||||||
@@ -2922,6 +2924,7 @@ class ForumChannel(discord.abc.GuildChannel, Hashable):
|
|||||||
applied_tags: Sequence[ForumTag] = MISSING,
|
applied_tags: Sequence[ForumTag] = MISSING,
|
||||||
view: BaseView = MISSING,
|
view: BaseView = MISSING,
|
||||||
suppress_embeds: bool = False,
|
suppress_embeds: bool = False,
|
||||||
|
silent: bool = False,
|
||||||
reason: Optional[str] = None,
|
reason: Optional[str] = None,
|
||||||
) -> ThreadWithMessage:
|
) -> ThreadWithMessage:
|
||||||
"""|coro|
|
"""|coro|
|
||||||
@@ -2976,6 +2979,11 @@ class ForumChannel(discord.abc.GuildChannel, Hashable):
|
|||||||
A list of stickers to upload. Must be a maximum of 3.
|
A list of stickers to upload. Must be a maximum of 3.
|
||||||
suppress_embeds: :class:`bool`
|
suppress_embeds: :class:`bool`
|
||||||
Whether to suppress embeds for the message. This sends the message without any embeds if set to ``True``.
|
Whether to suppress embeds for the message. This sends the message without any embeds if set to ``True``.
|
||||||
|
silent: :class:`bool`
|
||||||
|
Whether to suppress push and desktop notifications for the message. This will increment the mention counter
|
||||||
|
in the UI, but will not actually send a notification.
|
||||||
|
|
||||||
|
.. versionadded:: 2.7
|
||||||
reason: :class:`str`
|
reason: :class:`str`
|
||||||
The reason for creating a new thread. Shows up on the audit log.
|
The reason for creating a new thread. Shows up on the audit log.
|
||||||
|
|
||||||
@@ -3008,8 +3016,10 @@ class ForumChannel(discord.abc.GuildChannel, Hashable):
|
|||||||
if view and not hasattr(view, '__discord_ui_view__'):
|
if view and not hasattr(view, '__discord_ui_view__'):
|
||||||
raise TypeError(f'view parameter must be View not {view.__class__.__name__}')
|
raise TypeError(f'view parameter must be View not {view.__class__.__name__}')
|
||||||
|
|
||||||
if suppress_embeds:
|
if suppress_embeds or silent:
|
||||||
flags = MessageFlags._from_value(4)
|
flags = MessageFlags._from_value(0)
|
||||||
|
flags.suppress_embeds = suppress_embeds
|
||||||
|
flags.suppress_notifications = silent
|
||||||
else:
|
else:
|
||||||
flags = MISSING
|
flags = MISSING
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user