rHomelab / LabBot-Cogs

Cogs for the Red-based Homelab Discord server bot.
GNU General Public License v3.0
36 stars 14 forks source link

[BUG] pagify issue #120

Closed tigattack closed 3 years ago

tigattack commented 3 years ago

Describe the bug The enforcer cog throws an exception if you run ^enforcer status. Seems to be related to pagify.

To Reproduce Steps to reproduce the behavior:

  1. Run [p]enforcer status.
  2. See error.

Expected behavior I would expect to see the status of the enforcer cog.

Screenshots image

Additional context Traceback:


Exception in command 'enforcer status'
Traceback (most recent call last):
  File "/home/redbot/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/redbot/.local/share/Red-DiscordBot/data/LabBot/cogs/CogManager/cogs/enforcer/enforcer.py", line 262, in enforcer_status
    data.title = f"Enforcement Configuration - Page {i}/{len(pages)}"
TypeError: object of type 'generator' has no len()

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/redbot/.local/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 903, in invoke
    await ctx.command.invoke(ctx)
  File "/home/redbot/.local/lib/python3.8/site-packages/redbot/core/commands/commands.py", line 825, in invoke
    await super().invoke(ctx)
  File "/home/redbot/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 1329, in invoke
    await ctx.invoked_subcommand.invoke(ctx)
  File "/home/redbot/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 859, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/redbot/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: object of type 'generator' has no len()```
tigattack commented 3 years ago

The same bug appears to affect reactrole - Adding @issy.