Kreusada / Kreusada-Cogs

Cogs for Red-DiscordBot
https://kreusadacogs.readthedocs.io/en/latest/
MIT License
30 stars 18 forks source link

[discord.py 2.0] Cog Changes for dpy2. #211

Closed TwinDragon closed 2 years ago

TwinDragon commented 2 years ago

Type

Description of the changes

I'm going to use this PR as something to hold any changes for d.py2 related changes for cogs. My coding knowledge is extremely minimal, but in my testing and what I am aware of, the main difference for probably a majority of these cogs will be the avatar_url to avatar.url change.

I'll leave this particular PR open for anyone else that wants to add additional d.py2 related changes that I may not be aware of, or know how to fix. I'm probably not going to have enough time to test all of the cogs here (as I don't personally use them all) and am focusing on stuff I use. I may make some preliminary changes if I happen to find them, but likely may not be tested. The only two cogs I have actually tested are the following: advanceduptime, raffle.

This will close #210

TwinDragon commented 2 years ago

Recent commits in the d.py 2 side of things made pretty much most cogs will fail to load due to async changes. Looks like it's a simple adding async in the __init__.py to the def setup and await for bot.add_cog most likely. I'm just going off on what other people have done so far, so I'll do some tests soon.

I think all in all, may be wise to do a squash and merge when all is said and done. lol

And according to Max in the Red server, looks like cog unload will need some changes to. This might possibly be over my head, but I can get initial changes possibly to other things that I can do. We'll see.

Kreusada commented 2 years ago

I skimmed through AC the other day and this does seem to be the way forward. I guess it would be as simple as making all setup and cog_unload methods asynchronous, and then awaiting bot.add_cog as you said, along with your other changes. If you have time to make those appropriate changes then feel free, I probably won't have time to make them in time for "deadline" day.

I think all in all, may be wise to do a squash and merge when all is said and done. lol

Yeah haha, I'll be keeping this PR on hold until 3.5 is out and when we are aware of all the necessary changes.