Skip to content

feat: Add spoiler channel flag and functions - #3252

Open
ToothyDev wants to merge 33 commits into
masterfrom
feat/spoiler-channels
Open

ToothyDev wants to merge 33 commits into
masterfrom
feat/spoiler-channels

Conversation

@ToothyDev

@ToothyDev ToothyDev commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

This adds ChannelFlags.is_spoiler_channel (following https://docs.discord.food/resources/channel#channel-flags) as well as a .spoiler property to all applicable channel types (all except category). Same goes for making it possible to create these channels via the regular channel creation methods, again with the exception of category channels. Channel editing with this flag is also functional.

Now that it's officially documented, here's the ddocs PR: discord/discord-api-docs#8465

Depends on discord/discord-api-docs#8465

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.
  • AI Usage has been disclosed.
    • If AI has been used, I understand fully what the code does
  • I have read the Contributing Guidelines

@ToothyDev ToothyDev added upcoming discord feature Involves a feature not yet fully released by Discord on hold labels Jun 5, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Pycord Jun 5, 2026
@pycord-app

pycord-app Bot commented Jun 5, 2026

Copy link
Copy Markdown

Thanks for opening this pull request!
Please make sure you have read the Contributing Guidelines and Code of Conduct.

This pull request can be checked-out with:

git fetch origin pull/3252/head:pr-3252
git checkout pr-3252

This pull request can be installed with:

pip install git+https://github.com/Pycord-Development/pycord@refs/pull/3252/head

@ToothyDev ToothyDev added the hold: testing This pull request requires further testing label Jun 5, 2026

@Lulalaby Lulalaby left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

take a shower <3

@Lulalaby Lulalaby left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

took a shower apparently

@Lulalaby Lulalaby left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can someone request changes reminding me to add editing & creating channels with that flag
and whatever else i may have forgotten

@Soheab Soheab left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a way for bots to create this kind of channel

This message was sponsored by toothyfernsan on discord.

@Soheab Soheab added hold: changelog This pull request is missing a changelog entry and removed hold: changelog This pull request is missing a changelog entry labels Jun 5, 2026
@ToothyDev

Copy link
Copy Markdown
Contributor Author

I tested it with all but MediaChannels since I don't have access to those anywhere, but I'd still like a second pair of testing eyes on this

@ToothyDev ToothyDev moved this from Todo to In Progress in Pycord Jun 5, 2026
@ToothyDev

Copy link
Copy Markdown
Contributor Author

Also, creating a channel with this turned on isn't possible unfortunately, gotta create + edit

@Paillat-dev Paillat-dev added this to the 2.9.0rc1 milestone Jun 7, 2026
ToothyDev and others added 3 commits June 22, 2026 22:13
Signed-off-by: Lala Sabathil <lala@pycord.dev>
Signed-off-by: Lala Sabathil <lala@pycord.dev>
@github-actions github-actions Bot added the invalid This doesn't seem right label Jul 30, 2026
@github-actions

This comment was marked as resolved.

@github-actions github-actions Bot closed this Jul 30, 2026
@github-actions github-actions Bot locked as spam and limited conversation to collaborators Jul 30, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Pycord Jul 30, 2026
@Pycord-Development Pycord-Development unlocked this conversation Jul 30, 2026
vmphase
vmphase previously approved these changes Aug 17, 2026

@vmphase vmphase left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job.

@JustaSqu1d JustaSqu1d left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistency between notes and warnings for the documented behavior regarding NSFW and spoiler flag.

Comment thread discord/channel.py
Comment thread discord/channel.py
vmphase
vmphase previously approved these changes Sep 12, 2026

@vmphase vmphase left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from the technical side.

Comment thread CHANGELOG.md Outdated
Co-authored-by: Lala Sabathil <lala@pycord.dev>
Signed-off-by: ToothyDev <55001472+ToothyDev@users.noreply.github.com>
Comment thread discord/channel.py Outdated
Paillat-dev
Paillat-dev previously approved these changes Sep 18, 2026
@Paillat-dev

Copy link
Copy Markdown
Member

Thanks !

@vmphase vmphase left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this PR add any kind of support for spoiler on StageChannel, while documentation explicitly says:

IS_SPOILER_CHANNEL ... Can be set on all textual guild channels and voice channels (not GUILD_STAGE).

@ToothyDev

Copy link
Copy Markdown
Contributor Author

Why does this PR add any kind of support for spoiler on StageChannel, while documentation explicitly says:

IS_SPOILER_CHANNEL ... Can be set on all textual guild channels and voice channels (not GUILD_STAGE).

To stay internally consistent, because NSFW also doesn't work on stage channels, but Pycord supports it, it CAN be passed, it just has no effect. And actually, both toggles do exist (and work) in the client UI. Basically, everything works except it having an actual effect on the channel. So, while yes, it doesn't actually do anything, I still think it's worth keeping for internal consistency and because Discord might eventually make it work for stage channels (same for nsfw)

Comment thread discord/channel.py Outdated
Comment thread discord/guild.py
Comment on lines +1679 to +1680
reason: str | None = None,
category: CategoryChannel | None = None,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though there is no technical difference, I would rather tend to making these ... for consistency with other overloads PEP 484 stub conventions..

Comment thread discord/guild.py
Comment on lines +1849 to +1850
category: CategoryChannel | None = None,
reason: str | None = None,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in create_voice_channel overload.

Comment thread discord/guild.py Outdated
@vmphase

vmphase commented Sep 18, 2026

Copy link
Copy Markdown
Member

st has no effect. And actually, both toggles do exist (and work) in the client UI. Basically, everything works except it having an actual effect on the channel. So, while yes, it doesn't actually do anything, I still think it's worth keeping for internal consistency and because Discord might eventually make it work for stage channels (same for nsfw)

I see. If the development team is fine with this, sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

6 participants