Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 11 additions & 2 deletions discord/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,7 @@ def __init__(
): ...

def __str__(self) -> str:
flags = getattr(self, "flags", None)
if flags is not None and getattr(flags, "obfuscated", False):
if self.obfuscated:
return f"Obfuscated Channel ({self.id})"

return self.name
Expand Down Expand Up @@ -697,6 +696,16 @@ def permissions_synced(self) -> bool:
category = self.guild.get_channel(self.category_id)
return bool(category and category.overwrites == self.overwrites)

@property
def obfuscated(self) -> bool:
"""Whether the channel is obfuscated.

This is an alias for :attr:`~ChannelFlags.channel_obfuscated`.

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

def permissions_for(self, obj: Member | Role, /) -> Permissions:
"""Handles permission resolution for the :class:`~discord.Member`
or :class:`~discord.Role`.
Expand Down
2 changes: 1 addition & 1 deletion discord/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,7 @@ def hide_media_download_options(self):
return 1 << 15

@flag_value
def obfuscated(self):
def channel_obfuscated(self):
Comment thread
Paillat-dev marked this conversation as resolved.
""":class:`bool`: Returns ``True`` if the channel is obfuscated by the gateway."""

return 1 << 17
Expand Down