Skip to content

Commit

Permalink
Merge branch 'master' into permissions-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
krittick authored May 5, 2022
2 parents 5249f90 + 217da10 commit dfb9e2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion discord/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,11 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel):
.. versionadded:: 2.0
"""

__slots__ = ()
__slots__ = ('nsfw')

def _update(self, guild: Guild, data: VoiceChannelPayload):
super()._update(guild, data)
self.nsfw: bool = data.get("nsfw", False)

def __repr__(self) -> str:
attrs = [
Expand All @@ -942,6 +946,10 @@ def __repr__(self) -> str:
async def _get_channel(self):
return self

def is_nsfw(self) -> bool:
""":class:`bool`: Checks if the channel is NSFW."""
return self.nsfw

@property
def last_message(self) -> Optional[Message]:
"""Fetches the last message from this channel in cache.
Expand Down
2 changes: 1 addition & 1 deletion discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,7 @@ async def active_threads(self) -> List[Thread]:
return threads

# TODO: Remove Optional typing here when async iterators are refactored
def fetch_members(self, *, limit: Union[int, None] = 1000, after: Optional[SnowflakeTime] = None) -> MemberIterator:
def fetch_members(self, *, limit: Optional[int] = 1000, after: Optional[SnowflakeTime] = None) -> MemberIterator:
"""Retrieves an :class:`.AsyncIterator` that enables receiving the guild's members. In order to use this,
:meth:`Intents.members` must be enabled.
Expand Down

0 comments on commit dfb9e2b

Please sign in to comment.