Skip to content
Discussion options

You must be logged in to vote

To add a cog, create a discord.py-self cog and add it under line 107 in ghost.py. Here's an example:

Example Discord Cog code:

from discord.ext import commands

class ExampleCog(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        self.description = "Example commands"

    @commands.command(name="example")
    async def example(self, ctx):
        await ctx.send("Hello World!")

def setup(bot):
    bot.add_cog(ExampleCog(bot))

How to add the cog to Ghost, this line would go in the on_ready event in ghost.py.

await ghost.add_cog(ghost_commands.ExampleCog(ghost)) # If the cog is in the commands folder
await ghost.add_cog(ghost_events.ExampleCog(ghost)) # If the cog is …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@VrillSec
Comment options

@bennyscripts
Comment options

Answer selected by bennyscripts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants