scarletcafe / jishaku

A debugging and testing cog for discord.py rewrite bots.
https://jishaku.readthedocs.io/en/latest/
MIT License
543 stars 183 forks source link

Jishaku broke on discord.py new breaking changes #164

Closed timelessnesses closed 2 years ago

timelessnesses commented 2 years ago

Summary

Discord.py changed every cog action to asynchrnous so your setup won't works at all

Reproduction steps

Install discord.py from github
then load cog like this

await bot.load_extension('jishaku')

Expected results

The jishaku loaded successfully

Actual results

C:\Users\moopi\AppData\Local\pypoetry\Cache\virtualenvs\vynx_rewrite_2.0-0j8VIO9d-py3.9\lib\site-packages\jishaku\cog.py:55: RuntimeWarning: coroutine 'BotBase.add_cog' was never awaited
  bot.add_cog(Jishaku(bot=bot))
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
TagsCog - Unloaded
---
Traceback (most recent call last):
  File "C:\Users\moopi\AppData\Local\pypoetry\Cache\virtualenvs\vynx_rewrite_2.0-0j8VIO9d-py3.9\lib\site-packages\discord\ext\commands\bot.py", line 842, in _load_from_module_spec
    await setup(self)
TypeError: object NoneType can't be used in 'await' expression

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

Traceback (most recent call last):
  File "F:\Desktop\Vynx-Rewrite-2.0\main.py", line 139, in <module>
    asyncio.run(main(client))
  File "f:\python\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "f:\python\lib\asyncio\base_events.py", line 642, in run_until_complete
    return future.result()
  File "F:\Desktop\Vynx-Rewrite-2.0\main.py", line 131, in main
    await load_cogs(client)
  File "F:\Desktop\Vynx-Rewrite-2.0\main.py", line 111, in load_cogs
    await client.load_extension("jishaku")
  File "C:\Users\moopi\AppData\Local\pypoetry\Cache\virtualenvs\vynx_rewrite_2.0-0j8VIO9d-py3.9\lib\site-packages\discord\ext\commands\bot.py", line 908, in load_extension
    await self._load_from_module_spec(spec, name)
  File "C:\Users\moopi\AppData\Local\pypoetry\Cache\virtualenvs\vynx_rewrite_2.0-0j8VIO9d-py3.9\lib\site-packages\discord\ext\commands\bot.py", line 847, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'jishaku' raised an error: TypeError: object NoneType can't be used in 'await' expression

Checklist

System information

PS F:\Desktop\Vynx-Rewrite-2.0> pip show jishaku
Name: jishaku
Version: 2.3.2
Summary: A discord.py extension including useful tools for bot development and debugging.
Home-page: https://github.com/Gorialis/jishaku
Author: Devon (Gorialis) R
Author-email:
License: MIT
Location: c:\users\moopi\appdata\local\pypoetry\cache\virtualenvs\vynx_rewrite_2.0-0j8vio9d-py3.9\lib\site-packages
Requires: braceexpand, click, import-expression
Required-by:
PS F:\Desktop\Vynx-Rewrite-2.0> pip show discord.py
Name: discord.py
Version: 2.0.0a4081+g5892bbd8
Summary: A Python wrapper for the Discord API
Home-page: https://github.com/Rapptz/discord.py
Author: Rapptz
Author-email:
License: MIT
Location: c:\users\moopi\appdata\local\pypoetry\cache\virtualenvs\vynx_rewrite_2.0-0j8vio9d-py3.9\lib\site-packages
Requires: aiohttp
Required-by: discord, discord-ext-menus, slash-util
timelessnesses commented 2 years ago

nvm there's async_setup