I am trying to make the bot send a message every minute in discord.py. I do acknowledge that this is a easy thing to do but I have tried multiple times but resulting with no luc
You try to get channel with get_channel()
, but your bot is not ready yet. So you get NoneType
object, not channel. Try to this solution:
@tasks.loop(minutes=1)
async def test():
channel = client.get_channel(CHANNEL_ID)
await channel.send("test")
@client.event
async def on_ready():
test.start()