#Cog module missing?

1 messages · Page 1 of 1 (latest)

junior shale
#

show code

strong fractalBOT
junior shale
#

has the bot worked before this?

young smelt
#

you have client.start

#

client.run()

#

the class name of the cog is on_ready

#

also you use files and not cogs, so it would be files.{}

junior shale
#

you don't have a folder named cogs

#

load_extension takes a path. and cogs isn't a folder and doesn't exist

#

send file structure

young smelt
#

you search for files folder and not for the cogs folder

junior shale
#

remove await. load_extension isn't async

#

remove await from run

#

remove async from main and remove asyncio.run

#

remove async from load_files

young smelt
#

remove all the async and await in the main file

junior shale
#

just in this file at least

#

it's not magical, but sure

#

.tag solved

paper muskBOT
#

Done with your help thread?

Please close your own help thread by using </close:882631512829329448> with @ebon glade.

ebon gladeBOT
#

This thread was archived by the user that opened it.

winter void
#

I am getting a similar error

#
import os
import discord
from discord.ext import commands
import logging

##setting up logging 
logger = logging.getLogger('discord')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(filename='birdy.log', encoding='utf-8', mode='w')
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
logger.addHandler(handler)


intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix='/', intents=intents)

@bot.command()
async def ping(ctx):
  await ctx.send("Pong!")

#load extension
bot.load_extension('voice')



my_secret = os.environ['TOKEN']
bot.run(my_secret)
#
main.py:23: RuntimeWarning: coroutine 'BotBase.load_extension' was never awaited
  bot.load_extension('voice')
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
#

I am not able to load the extension without using the await keyword

junior shale
winter void
#

That was fast

#

Thank you so much for responding

#

That resolved the issue 😃