Add Cog to bot in Discord.py 1

Add Cog to bot in Discord.py

bot.add_cog(Greetings(bot))

Here is what the above code is Doing:
1. We import the commands module, which is a submodule of discord.py.
2. We create a subclass of commands.Cog, which is a base class for cogs.
3. We create a constructor for our cog, which takes a bot argument.
4. We create a command called greet, which takes a ctx argument.
5. We add our cog to the bot using the add_cog method.

Similar Posts