pycord: discord.ForumChannel Bug

Summary

discord.ForumChannel not showing Forum Channels

Reproduction Steps

https://docs.pycord.dev/en/master/api/models.html#discord.ForumChannel

Minimal Reproducible Code

@slash_command()
    async def forum(self, ctx, forum: discord.Option(discord.ForumChannel, "..")):
        print(forum)
        print(forum.category)

Expected Results

Showing Forum Channels

Actual Results

Not Showing Forum Channels

Intents

All

System Information

  • Python v3.11.1-final
  • py-cord v2.3.2-final
  • aiohttp v3.8.3
  • system info: Windows 10 10.0.19045

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

Credits to : zReaxrYT#1799 for finding the Bug.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

Also bear in mind ForumChannels came way after this was implemented, adding support for it shouldn’t be too hard so I’ll look into that within the next hour or so.

try discord.SlashCommandOptionType.channel, channel_types=[discord.ChannelType.forum]

You’re meant to use the channel_types argument in discord.Option.

    @slash_command()
    async def forum(self, ctx, forum: discord.Option(discord.TextChannel, channel_types=[discord.ChannelType.forum])):
        ...

Though I fully understand the confusion:

  1. This still isn’t documented… I’ll do it now since I’m free
  2. Considering all the other types we have, the code in the OP seem like it should work.
  3. To add to the above, the example code I used above isn’t exactly ideal since it’s two clashing types. If I’m not mistaken, using channel_types overrides the option type channel.

And I think the code is wrong @Pycord-Development/contributors?

image This is what discord.py is showing when you use discord.ForumChannel.

It’s also not working with async def forum(self, ctx, forum: discord.Option(discord.ForumChannel)): nor async def forum(self, ctx, forum: discord.ForumChannel) is working either. I mean, go ahead and test it yourself.