mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
Include bot as an argument to the cog class in the cog creation guide (#4988)
This commit is contained in:
parent
5de65a74b5
commit
0447b5648a
@ -86,6 +86,9 @@ In that file, place the following code:
|
||||
class MyCog(commands.Cog):
|
||||
"""My custom cog"""
|
||||
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
@commands.command()
|
||||
async def mycom(self, ctx):
|
||||
"""This does stuff!"""
|
||||
@ -100,7 +103,7 @@ Open :code:`__init__.py`. In that file, place the following:
|
||||
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(MyCog())
|
||||
bot.add_cog(MyCog(bot))
|
||||
|
||||
Make sure that both files are saved.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user