bot icon indicating copy to clipboard operation
bot copied to clipboard

Async function remove_cog not awaited

Open shtlrs opened this issue 4 years ago • 3 comments

If you take a look at this line https://github.com/python-discord/bot/blob/71fbd5aa7ef8fdf3547dbae845cf7e6b9bc08277/bot/exts/moderation/watchchannels/_watchchannel.py#L131

You'll see that the remove_cog async func isn't awaited.

shtlrs avatar Sep 27 '22 23:09 shtlrs

Can someone assign this to me? I'll include it in the PR for the other bug ino working on.

shtlrs avatar Sep 27 '22 23:09 shtlrs

Looks like a remnant of the move to discord.py 2.0.

I'm not sure awaiting it works. iirc raising an error will cause it to unload. Worth checking.

mbaruh avatar Sep 28 '22 04:09 mbaruh

@mbaruh do you mean the fact that it isn't awaited will throw and thus would still unload the cog?

I noticed it upon unloading a cog actually, and I thought it was ugly to have that exception in our logs.

BTW, couldn't this have been avoided if we used something like mypy? Why don't we actually have that in our project?

shtlrs avatar Sep 28 '22 05:09 shtlrs