Better TextChannel.is_nsfw() check.
This commit is contained in:
parent
10453d6718
commit
3f45db5c3b
@ -113,7 +113,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
|
|||||||
def is_nsfw(self):
|
def is_nsfw(self):
|
||||||
"""Checks if the channel is NSFW."""
|
"""Checks if the channel is NSFW."""
|
||||||
n = self.name
|
n = self.name
|
||||||
return n == 'nsfw' if len(n) < 5 else n[:5] == 'nsfw-'
|
return n == 'nsfw' or n[:5] == 'nsfw-'
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def edit(self, **options):
|
def edit(self, **options):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user