From 7f171797ffe4fdd65e40811e3df32502e0b5004f Mon Sep 17 00:00:00 2001 From: andrei Date: Sat, 9 Mar 2019 09:09:00 -0800 Subject: [PATCH] Add support for guild news channels --- disco/types/channel.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/disco/types/channel.py b/disco/types/channel.py index 3e84a9e..48e7694 100644 --- a/disco/types/channel.py +++ b/disco/types/channel.py @@ -20,6 +20,7 @@ ChannelType = Enum( GUILD_VOICE=2, GROUP_DM=3, GUILD_CATEGORY=4, + GUILD_NEWS=5, ) PermissionOverwriteType = Enum( @@ -190,7 +191,20 @@ class Channel(SlottedModel, Permissible): """ Whether this channel belongs to a guild. """ - return self.type in (ChannelType.GUILD_TEXT, ChannelType.GUILD_VOICE, ChannelType.GUILD_CATEGORY) + return self.type in ( + ChannelType.GUILD_TEXT, + ChannelType.GUILD_VOICE, + ChannelType.GUILD_CATEGORY, + ChannelType.GUILD_NEWS, + ) + + @property + def is_news(self): + """ + Whether this channel contains news for the guild (used for verified guilds + to produce activity feed news). + """ + return self.type == ChannelType.GUILD_NEWS @property def is_dm(self):