phenom4n4n / phen-cogs

My public cogs for Red, Discord bot.
https://phen-cogs.readthedocs.io/en/latest/
MIT License
120 stars 71 forks source link

[Baron] fix `build_cache` missing. #145

Closed japandotorg closed 1 year ago

japandotorg commented 1 year ago

Looks like bc of the last PR I made for the async cog loading, I have had mistakenly changed build_cache with cog_load, which went un-noticed, and was erroring out the cog.

Exception in command 'baron whitelist'
Traceback (most recent call last):
  File "/home/ubuntu/redenv/lib/python3.10/site-packages/discord/ext/commands/core.py", line 229, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/ubuntu/redbot/cogs/CogManager/cogs/baron/baron.py", line 221, in whitelist
    await self.build_cache()
AttributeError: 'Baron' object has no attribute 'build_cache'

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

Traceback (most recent call last):
  File "/home/ubuntu/redenv/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 1350, in invoke
    await ctx.command.invoke(ctx)
  File "/home/ubuntu/redenv/lib/python3.10/site-packages/redbot/core/commands/commands.py", line 782, in invoke
    await super().invoke(ctx)
  File "/home/ubuntu/redenv/lib/python3.10/site-packages/discord/ext/commands/core.py", line 1642, in invoke
    await ctx.invoked_subcommand.invoke(ctx)
  File "/home/ubuntu/redenv/lib/python3.10/site-packages/discord/ext/commands/core.py", line 1023, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
  File "/home/ubuntu/redenv/lib/python3.10/site-packages/discord/ext/commands/core.py", line 238, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Baron' object has no attribute 'build_cache'

This PR fixes the above exception.

phenom4n4n commented 1 year ago

Thanks!