Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b1ded01
Add spoiler channel flag and functions
ToothyDev Jun 5, 2026
7b79faa
Add editing spoiler flag to channel editing functions
ToothyDev Jun 5, 2026
9d09881
Merge branch 'master' into feat/spoiler-channels
ToothyDev Jun 22, 2026
65bfc90
Merge branch 'master' into feat/spoiler-channels
Lulalaby Jul 30, 2026
f426f25
fix: changelog
Lulalaby Jul 30, 2026
cb9f534
Merge branch 'master' into feat/spoiler-channels
Lulalaby Jul 30, 2026
7aaad87
Merge branch 'master' into feat/spoiler-channels
ToothyDev Aug 4, 2026
769cc08
Make spoiler attribute a property
ToothyDev Aug 4, 2026
19531ba
Add mutual exclusivity check for nsfw and spoiler options
ToothyDev Aug 4, 2026
16309ed
Merge branch 'master' into feat/spoiler-channels
ToothyDev Aug 4, 2026
68608ab
Adjust changelog to new naming
ToothyDev Aug 10, 2026
763c13f
Merge branch 'master' into feat/spoiler-channels
Lulalaby Aug 10, 2026
f2cb6bb
Add channel creation support with spoiler flag
ToothyDev Aug 10, 2026
9508a82
Add channel creation support with spoiler flag
ToothyDev Aug 10, 2026
4f41083
Minor documentation formatting
ToothyDev Aug 10, 2026
7327338
Fix value defaulting
ToothyDev Aug 10, 2026
57e3dd7
Address code review change requests
ToothyDev Aug 10, 2026
06167d2
Warn when passing both nsfw and spoiler options
ToothyDev Aug 10, 2026
c8f6f61
Add overloads for voice and forum channels
ToothyDev Aug 11, 2026
b56e022
Apply change requests from code review
ToothyDev Aug 11, 2026
2582634
Apply change requests from code review
ToothyDev Aug 11, 2026
ccca218
Fix edit() overloads
ToothyDev Aug 12, 2026
74dda97
Address change requests
ToothyDev Aug 13, 2026
0e64964
Merge branch 'master' into feat/spoiler-channels
ToothyDev Aug 14, 2026
8fcaf91
fixup! Merge branch 'master' into feat/spoiler-channels
ToothyDev Aug 14, 2026
414bd34
Address change requests
ToothyDev Aug 15, 2026
ca98dd2
Address change requests
ToothyDev Aug 17, 2026
7257401
Address change requests and unify warnings to be notes
ToothyDev Aug 23, 2026
3eeab68
Merge branch 'master' into feat/spoiler-channels
ToothyDev Aug 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ These changes are available on the `master` branch, but have not yet been releas

### Added

- Added `ChannelFlags.is_spoiler_channel` and `.is_spoiler()` function to all applicable
channel types. ([#3252](https://github.com/Pycord-Development/pycord/pull/3252))

### Changed

### Fixed
Expand Down
21 changes: 21 additions & 0 deletions discord/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,13 @@ def is_nsfw(self) -> bool:
"""Checks if the channel is NSFW."""
return self.nsfw

def is_spoiler(self) -> bool:
"""Checks if the channel is a spoiler channel.
Comment thread
ToothyDev marked this conversation as resolved.

.. versionadded:: 2.9
"""
return self.flags.is_spoiler_channel

Comment thread
ToothyDev marked this conversation as resolved.
Outdated
@property
def last_message(self) -> Message | None:
"""Fetches the last message from this channel in cache.
Expand Down Expand Up @@ -1810,6 +1817,13 @@ def is_nsfw(self) -> bool:
"""Checks if the channel is NSFW."""
return self.nsfw

def is_spoiler(self) -> bool:
"""Checks if the channel is a spoiler channel.

Comment thread
ToothyDev marked this conversation as resolved.
.. versionadded:: 2.9
"""
return self.flags.is_spoiler_channel

Comment thread
ToothyDev marked this conversation as resolved.
Outdated
@property
def last_message(self) -> Message | None:
"""Fetches the last message from this channel in cache.
Expand Down Expand Up @@ -2398,6 +2412,13 @@ def is_nsfw(self) -> bool:
"""Checks if the channel is NSFW."""
return self.nsfw

def is_spoiler(self) -> bool:
"""Checks if the channel is a spoiler channel.

Comment thread
ToothyDev marked this conversation as resolved.
.. versionadded:: 2.9
"""
return self.flags.is_spoiler_channel
Comment thread
ToothyDev marked this conversation as resolved.
Outdated

@property
def last_message(self) -> Message | None:
"""Fetches the last message from this channel in cache.
Expand Down
8 changes: 8 additions & 0 deletions discord/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,14 @@ def hide_media_download_options(self):
"""
return 1 << 15

@flag_value
def is_spoiler_channel(self):
Comment thread
ToothyDev marked this conversation as resolved.
""":class:`bool`: Returns ``True`` if the channel is a spoiler channel.

.. versionadded:: 2.9
"""
return 1 << 21


@fill_with_flags()
class AttachmentFlags(BaseFlags):
Expand Down
Loading