Skip to content

is_nsfw is always false for threads #10248

@Armen138

Description

@Armen138

Summary

calling is_nsfw() on a thread always returns False, even if the parent channel allows NSFW

Reproduction Steps

When accessing the thread through the interaction.channel object, interaction.channel.is_nsfw() always returns False, even if the parent channel has the nsfw flag. Additionally, interaction.channel.parent is None, where I'd expect the parent channel.

Minimal Reproducible Code

channel = interaction.channel.parent or interaction.channel
logger.info(f"Channel: {channel}")
logger.info(f"Thread Parent: {interaction.channel.parent}")
nsfw_allowed = channel.is_nsfw() if hasattr(channel, 'is_nsfw') else False
logger.info(f"NSFW allowed: {nsfw_allowed}")
# returns True for an nsfw channel, but False for a thread in that channel

Expected Results

interaction.channel.is_nsfw() should return True if called from a thread inside an NSFW channel

Actual Results

interaction.channel.is_nsfw() returns False if called from a thread inside an NSFW channel

Intents

message_content

System Information

  • Python v3.13.3-final
  • discord.py v2.5.2-final
  • aiohttp v3.12.15
  • system info: Linux 6.14.0-23-generic Role.is_everyone() is broken #23-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 13 23:02:20 UTC 2025

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    unconfirmed bugA bug report that needs triaging

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions