from discord.ext import commands, tasks
class sendmessage10seconds(commands.Cog):
def __init__(self, client):
self.client = client
print("Cog is running")
@tasks.loop(seconds=10)
async def sendmessage(ctx, self):
channel = self.get_channel(802273252973477960)
await channel.send("Hi")
sendmessage.start()
def setup(client):
client.add_cog(sendmessage10seconds(client))
This is my code so far. When I run it I get this error:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/tasks/__init__.py", line 101, in _loop
await self.coro(*args, **kwargs)
TypeError: sendmessage() missing 2 required positional arguments: 'ctx' and 'self'
What am I doing wrong?