I am trying to move my discord.py code into cogs. I keep on getting the same error Exception has occurred: ModuleNotFoundError No module named 'cogs'.
bot.py
from discord.ext import commands
bot = commands.Bot(command_prefix='!')
bot.load_extension('cogs.maincog')
bot.run('token')
maincog.py
from discord.ext import commands
class MainCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def test(self, ctx):
await ctx.send("test")
def setup(bot):
bot.add_cog(MainCog(bot))
Folder:
Thanks!
