Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

guild.by_category() not returning empty categories #4186

Closed
3 tasks done
eri opened this issue Jun 8, 2020 · 1 comment
Closed
3 tasks done

guild.by_category() not returning empty categories #4186

eri opened this issue Jun 8, 2020 · 1 comment
Labels
bug This is a bug with the library.
Milestone

Comments

@eri
Copy link

eri commented Jun 8, 2020

Summary

I was looking for listing all of the channels (including all types) with categories (sorted correctly like in UI) and found that comment from Danny on issue #2392. I noticed that the result returned by that method ignores empty categories (categories with no channels in it) for some reasons.

Reproduction Steps

  • Create a guild with two categories
  • Create some test channels under one of the categories, leave the other empty
  • Use ctx.guild.by_category() and see results
    @commands.command()
    async def test(self, ctx):
      await ctx.send(ctx.guild.by_category()) # Supposed to return both categories
      await ctx.send(len(ctx.guild.by_category())) # Supposed to return 2

Expected Results

It should return all categories, so 2 in total.

Actual Results

It ignores the empty category and only returns one.

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.

System Information

  • Python v3.6.9-final
  • discord.py v1.3.3-final
  • aiohttp v3.6.2
  • websockets v8.1
  • system info: Linux 4.15.0-99-generic ffmpeg Not played in loop #100-Ubuntu SMP Wed Apr 22 20:32:56 UTC 2
    020
@Rapptz Rapptz added the bug This is a bug with the library. label Jun 27, 2020
@Rapptz Rapptz added this to the 1.4 milestone Jun 27, 2020
@Rapptz
Copy link
Owner

Rapptz commented Jun 27, 2020

This should be fixed by c01bf7c

@Rapptz Rapptz closed this as completed Jun 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is a bug with the library.
Projects
None yet
Development

No branches or pull requests

2 participants