2626from datetime import datetime
2727
2828from .errors import MissingApplicationID
29- from ..flags import AppCommandContext , AppInstallationType
29+ from ..flags import AppCommandContext , AppInstallationType , ChannelFlags
3030from .translator import TranslationContextLocation , TranslationContext , locale_str , Translator
3131from ..permissions import Permissions
3232from ..enums import (
@@ -575,6 +575,35 @@ class AppCommandChannel(Hashable):
575575 the application command in that channel.
576576 guild_id: :class:`int`
577577 The guild ID this channel belongs to.
578+ category_id: Optional[:class:`int`]
579+ The category channel ID this channel belongs to, if applicable.
580+
581+ .. versionadded:: 2.6
582+ topic: Optional[:class:`str`]
583+ The channel's topic. ``None`` if it doesn't exist.
584+
585+ .. versionadded:: 2.6
586+ position: :class:`int`
587+ The position in the channel list. This is a number that starts at 0. e.g. the
588+ top channel is position 0.
589+
590+ .. versionadded:: 2.6
591+ last_message_id: Optional[:class:`int`]
592+ The last message ID of the message sent to this channel. It may
593+ *not* point to an existing or valid message.
594+
595+ .. versionadded:: 2.6
596+ slowmode_delay: :class:`int`
597+ The number of seconds a member must wait between sending messages
598+ in this channel. A value of ``0`` denotes that it is disabled.
599+ Bots and users with :attr:`~discord.Permissions.manage_channels` or
600+ :attr:`~discord.Permissions.manage_messages` bypass slowmode.
601+
602+ .. versionadded:: 2.6
603+ nsfw: :class:`bool`
604+ If the channel is marked as "not safe for work" or "age restricted".
605+
606+ .. versionadded:: 2.6
578607 """
579608
580609 __slots__ = (
@@ -583,6 +612,14 @@ class AppCommandChannel(Hashable):
583612 'name' ,
584613 'permissions' ,
585614 'guild_id' ,
615+ 'topic' ,
616+ 'nsfw' ,
617+ 'position' ,
618+ 'category_id' ,
619+ 'slowmode_delay' ,
620+ 'last_message_id' ,
621+ '_last_pin' ,
622+ '_flags' ,
586623 '_state' ,
587624 )
588625
@@ -599,6 +636,14 @@ def __init__(
599636 self .type : ChannelType = try_enum (ChannelType , data ['type' ])
600637 self .name : str = data ['name' ]
601638 self .permissions : Permissions = Permissions (int (data ['permissions' ]))
639+ self .topic : Optional [str ] = data .get ('topic' )
640+ self .position : int = data .get ('position' ) or 0
641+ self .nsfw : bool = data .get ('nsfw' ) or False
642+ self .category_id : Optional [int ] = _get_as_snowflake (data , 'parent_id' )
643+ self .slowmode_delay : int = data .get ('rate_limit_per_user' ) or 0
644+ self .last_message_id : Optional [int ] = _get_as_snowflake (data , 'last_message_id' )
645+ self ._last_pin : Optional [datetime ] = parse_time (data .get ('last_pin_timestamp' ))
646+ self ._flags : int = data .get ('flags' , 0 )
602647
603648 def __str__ (self ) -> str :
604649 return self .name
@@ -611,6 +656,28 @@ def guild(self) -> Optional[Guild]:
611656 """Optional[:class:`~discord.Guild`]: The channel's guild, from cache, if found."""
612657 return self ._state ._get_guild (self .guild_id )
613658
659+ @property
660+ def flags (self ) -> ChannelFlags :
661+ """:class:`~discord.ChannelFlags`: The flags associated with this channel object.
662+
663+ .. versionadded:: 2.6
664+ """
665+ return ChannelFlags ._from_value (self ._flags )
666+
667+ def is_nsfw (self ) -> bool :
668+ """:class:`bool`: Checks if the channel is NSFW.
669+
670+ .. versionadded:: 2.6
671+ """
672+ return self .nsfw
673+
674+ def is_news (self ) -> bool :
675+ """:class:`bool`: Checks if the channel is a news channel.
676+
677+ .. versionadded:: 2.6
678+ """
679+ return self .type == ChannelType .news
680+
614681 def resolve (self ) -> Optional [GuildChannel ]:
615682 """Resolves the application command channel to the appropriate channel
616683 from cache if found.
0 commit comments