Skip to content
Discussion options

You must be logged in to vote

You don't need to modify any source to do this. Just use standard Python functions. Your best bet is to do this before the bot is closed, so something like this:

from discord.ext import commands

class MyBot(commands.Bot):
    async def my_finalizer(self):
        # do whatever here
        pass

    async def close(self):
        await self.my_finalizer()
        await super().close()

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants