Skip to content

Conversation

feelixs
Copy link
Contributor

@feelixs feelixs commented Mar 2, 2025

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

Description

  • added support for accessing the .nsfw property on channels inheriting from ThreadChannel
  • Discord doesn't let you change the "age restricted" setting on threads, they always inherit this setting from their parent channel.

Changes

  • add .nsfw property to ThreadChannel, inheriting from its parent Text Channel

Related Issues

Test Scenarios

@slash_command(name="show", description="display this channels nsfw setting")
async def show(ctx: SlashContext):
    await ctx.send(str(ctx.channel.nsfw))
  • Without this patch, running this command in a thread will raise AttributeError: 'GuildPublicThread' object has no attribute 'nsfw'

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x

Checklist

  • I've run the pre-commit code linter over all edited files
  • I've tested my changes on supported Python versions
  • I've added tests for my code, if applicable
  • I've updated / added documentation, where applicable

@feelixs feelixs changed the base branch from stable to unstable March 2, 2025 17:32
@silasary silasary merged commit 26ca893 into interactions-py:unstable Mar 3, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants