I wanted to use cogs to categorize commands and to not have to restart my whole bot to make an update to certain commands.
So I added the cogs and added my first command and everything worked: the command ran and I could update and reload it without having to restart my bot, but I noticed the async def coroutine didn't run no matter what.
I tried using asyncio.run() instead of await but that didn't help. I added the coroutine and the command back to the main file and everything worked. I don't get any error messages it just refuses to run. I would like to know what I'm doing wrong since I'm pretty new to cogs.
Cogs file:
class MembersCog(commands.Cog):
def __init__(self, client):
self.client = client
async def printfunc(self):
print("coroutine just ran") #This never runs.
@commands.command()
async def test(self, ctx):
print("command just ran")
await printfunc()
def setup(client):
client.add_cog(MembersCog(client))