mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-07 01:42:30 -05:00
Update dependencies and copyright year (#2436)
- aiohttp 3.5 - websockets 7 - Rapptz/discord.py@700dbb5 - A few others Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
"""
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-2017 Rapptz
|
||||
Copyright (c) 2015-2019 Rapptz
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
@@ -667,6 +667,28 @@ class CategoryChannel(discord.abc.GuildChannel, Hashable):
|
||||
ret.sort(key=comparator)
|
||||
return ret
|
||||
|
||||
@property
|
||||
def text_channels(self):
|
||||
"""List[:class:`TextChannel`]: Returns the text channels that are under this category."""
|
||||
ret = [
|
||||
c
|
||||
for c in self.guild.channels
|
||||
if c.category_id == self.id and isinstance(c, TextChannel)
|
||||
]
|
||||
ret.sort(key=lambda c: (c.position, c.id))
|
||||
return ret
|
||||
|
||||
@property
|
||||
def voice_channels(self):
|
||||
"""List[:class:`VoiceChannel`]: Returns the text channels that are under this category."""
|
||||
ret = [
|
||||
c
|
||||
for c in self.guild.channels
|
||||
if c.category_id == self.id and isinstance(c, VoiceChannel)
|
||||
]
|
||||
ret.sort(key=lambda c: (c.position, c.id))
|
||||
return ret
|
||||
|
||||
|
||||
class DMChannel(discord.abc.Messageable, Hashable):
|
||||
"""Represents a Discord direct message channel.
|
||||
|
||||
Reference in New Issue
Block a user