Channel news, so how do you get them? #1156
-
text_channels = sum(1 for channel in server.channels if isinstance(channel, disnake.TextChannel))
voice_channels = sum(1 for channel in server.channels if isinstance(channel, disnake.VoiceChannel))
stage_channels = sum(1 for channel in server.channels if isinstance(channel, disnake.StageChannel))
announcement_channels = sum(1 for channel in server.channels if isinstance(channel, disnake.DMChannel)) ---> that's the problem.
forum_channels = sum(1 for channel in server.channels if isinstance(channel, disnake.ForumChannel)) I am able to read all channel types except announcement, can you explain what I am doing wrong? |
Beta Was this translation helpful? Give feedback.
Answered by
elenakrittik
Feb 6, 2024
Replies: 1 comment 2 replies
-
News channels are announcement_channels = sum(1 for channel in server.text_channels if channel.is_news()) |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
antsently
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
News channels are
TextChannel
s withis_news() -> True
, so to count news channels you'll need to do this instead: