Maybe-Useful-Cogs icon indicating copy to clipboard operation
Maybe-Useful-Cogs copied to clipboard

[Leveler] cog will not load anymore

Open GSecurity opened this issue 6 years ago • 5 comments

Hi, Since some time (didn't see exactly when it was happening first, but from the logs, looks like it first had this issue 10/09/2017), I can't load the Leveler cog and have the following error: [07/03/2018 21:01] ERROR red load_cogs 573: Command role is already registered. Traceback (most recent call last): File "red.py", line 570, in load_cogs owner_cog._load_cog(extension) File "/home/gsecurity/Red-DiscordBot/cogs/owner.py", line 948, in _load_cog self.bot.load_extension(mod_obj.__name__) File "lib/discord/ext/commands/bot.py", line 738, in load_extension lib.setup(self) File "/home/gsecurity/Red-DiscordBot/cogs/leveler.py", line 3286, in setup bot.add_cog(n) File "lib/discord/ext/commands/bot.py", line 655, in add_cog self.add_command(member) File "lib/discord/ext/commands/core.py", line 487, in add_command raise discord.ClientException('Command {0.name} is already registered.'.format(command)) discord.errors.ClientException: Command role is already registered. I really have no idea what is causing this. If I force load the cog with the !load command, I will get this error: [07/03/2018 20:52] ERROR owner load 74: Command role is already registered. Traceback (most recent call last): File "/home/gsecurity/Red-DiscordBot/cogs/owner.py", line 65, in load self._load_cog(module) File "/home/gsecurity/Red-DiscordBot/cogs/owner.py", line 948, in _load_cog self.bot.load_extension(mod_obj.__name__) File "lib/discord/ext/commands/bot.py", line 738, in load_extension lib.setup(self) File "/home/gsecurity/Red-DiscordBot/cogs/leveler.py", line 3286, in setup bot.add_cog(n) File "lib/discord/ext/commands/bot.py", line 655, in add_cog self.add_command(member) File "lib/discord/ext/commands/core.py", line 487, in add_command raise discord.ClientException('Command {0.name} is already registered.'.format(command)) discord.errors.ClientException: Command role is already registered. and the cog is deactivated by the boat for loading next time. But, at this stage, manually loading the cog with !load will give the above error, but afterwards seems to work.

Any idea ?

(Red is up-to-date so is leveler). Thank you. Regards.

GSecurity avatar Mar 07 '18 20:03 GSecurity

When you get this error, what is the output of [p]debug bot.commands['role'].module ?

calebj avatar Mar 17 '18 09:03 calebj

Here's the output: <module 'cogs.customroles' from '/home/gsecurity/Red-DiscordBot/cogs/customroles.py'> I guess it's related to this cog?: https://cogs.red/cogs/PaddoInWonderland/PaddoCogs/customroles/ But don't see why it would interfere if it's that :/

GSecurity avatar Mar 17 '18 16:03 GSecurity

It interferes because leveler also has a command named role, which is too generic imo because of the possibility of this exact thing. Best to rename it in the code for now to something like lvrole.

calebj avatar Mar 17 '18 16:03 calebj

Ok, thank you, gonna try to change this. Hope you'll fix this in a next version too like you said to something less "generic" :D [Edit] Proposed fix worked just fine ;) Thanks again.

GSecurity avatar Mar 17 '18 17:03 GSecurity

Close this thread :thinking:

Catacalys avatar Nov 15 '18 21:11 Catacalys