Dav-Git / Dav-Cogs

Dav's cogs for Red-DiscordBot
GNU General Public License v3.0
33 stars 28 forks source link

Red 3.5 changes #103

Closed Dav-Git closed 1 year ago

Dav-Git commented 2 years ago

This PR contains all changes required to make my cogs compatible with dpy 2.0 and Red 3.5

Mister-42 commented 2 years ago

I used this to get some cogs working in both version at the same time. Maybe it helps

async def setup(bot: Red) -> None:
    cog = Botstatus(bot)
    if discord.version_info.major == 2:
        await bot.add_cog(cog)
    else:
        bot.add_cog(cog)
    cog.init()