adding cogs #25
|
How would one go around adding another categories to this sb? Nothin i do seems to work |
Answered by
bennyscripts
Mar 28, 2025
Replies: 1 comment 2 replies
|
To add a cog, create a discord.py-self cog and add it under line 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 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 in the events folder |
2 replies
Answer selected by
bennyscripts
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To add a cog, create a discord.py-self cog and add it under line
107inghost.py. Here's an example:Example Discord Cog code:
How to add the cog to Ghost, this line would go in the
on_readyevent inghost.py.