You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if you make your bot a bridge bot, and try to unload or reload a cog it'll fail
Reproduction Steps
Make a bridge bot
Make a cog
Unload or reload that (or another) cog
Done
Minimal Reproducible Code
fromdiscord.extimportbridgebot=bridge.Bot()
bot.load_extension("cog") #Loads all cogs in the cogs folderbot.run(TOKEN)
Now in a another file called cog.py
fromdiscord.extimportcommands, bridgeclassName(commands.Cog):
def__init__(self, bot):
self.bot=bot@bridge.bridge_command()asyncdefping(self, ctx):
awaitctx.respond ("Pong!")
@bridge.bridge_command()asyncdefaction(self, ctx):
self.bot.unload_extension("cog")
#self.bot.reload_extension("cog") Same appliesawaitctx.respond ("Observe the error.")
defsetup(bot):
bot.add_cog(Name(bot))
Expected Results
The cog is unloaded or reloaded
Actual Results
The cog is not unloaded or reloaded
Intents
guilds=True, guild_messages=True
System Information
Python v3.11.1-final
py-cord v2.3.2-final
aiohttp v3.7.4.post0
system info: Windows 10 10.0.22621 (Not true, im actually running windows 11)
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
Tracebacl:
Ignoring exception in on_application_command_error
Traceback (most recent call last):
File "C:\Users\MYPCNAME\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 124, in wrapped
ret = await coro(arg)
^^^^^^^^^^^^^^^
File "C:\Users\MYPCNAME\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 976, in _invoke
await self.callback(self.cog, ctx, **kwargs)
File "C:\Users\MYPCNAME\Documents\GitHub\pingernos-py\cogs\cogs.py", line 34, in cogs
raise e
File "C:\Users\MYPCNAME\Documents\GitHub\pingernos-py\cogs\cogs.py", line 29, in cogs
self.bot.unload_extension(f"cogs.{cog}") (Same happens with reload_extension)
File "C:\Users\MYPCNAME\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\cog.py", line 1066, in unload_extension
self._remove_module_references(lib.name)
File "C:\Users\MYPCNAME\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\cog.py", line 722, in _remove_module_references
self.remove_cog(cog_name)
File "C:\Users\MYPCNAME\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\cog.py", line 706, in remove_cog
cog._eject(self)
File "C:\Users\MYPCNAME\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\cog.py", line 592, in _eject
bot.remove_command(command.name)
^^^^^^^^^^^^
AttributeError: 'BridgeCommand' object has no attribute 'name'
Its not the same code as the code i gave, but there's almost no difference and the error will still happen, i also tried it on my other cogs and the same happened.
The text was updated successfully, but these errors were encountered:
Summary
if you make your bot a bridge bot, and try to unload or reload a cog it'll fail
Reproduction Steps
Minimal Reproducible Code
Now in a another file called cog.py
Expected Results
The cog is unloaded or reloaded
Actual Results
The cog is not unloaded or reloaded
Intents
guilds=True, guild_messages=True
System Information
Checklist
Additional Context
Tracebacl:
Ignoring exception in on_application_command_error
Traceback (most recent call last):
File "C:\Users\MYPCNAME\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 124, in wrapped
ret = await coro(arg)
^^^^^^^^^^^^^^^
File "C:\Users\MYPCNAME\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 976, in _invoke
await self.callback(self.cog, ctx, **kwargs)
File "C:\Users\MYPCNAME\Documents\GitHub\pingernos-py\cogs\cogs.py", line 34, in cogs
raise e
File "C:\Users\MYPCNAME\Documents\GitHub\pingernos-py\cogs\cogs.py", line 29, in cogs
self.bot.unload_extension(f"cogs.{cog}") (Same happens with reload_extension)
File "C:\Users\MYPCNAME\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\cog.py", line 1066, in unload_extension
self._remove_module_references(lib.name)
File "C:\Users\MYPCNAME\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\cog.py", line 722, in _remove_module_references
self.remove_cog(cog_name)
File "C:\Users\MYPCNAME\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\cog.py", line 706, in remove_cog
cog._eject(self)
File "C:\Users\MYPCNAME\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\cog.py", line 592, in _eject
bot.remove_command(command.name)
^^^^^^^^^^^^
AttributeError: 'BridgeCommand' object has no attribute 'name'
Its not the same code as the code i gave, but there's almost no difference and the error will still happen, i also tried it on my other cogs and the same happened.
The text was updated successfully, but these errors were encountered: