如何执行discord.py循环任务



这是我的代码,但我不能让循环工作

import discord
from discord.ext import tasks, commands
client = discord.Client()
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('!test'):
await message.channel.send('Working')
@tasks.loop(seconds = 10)
async def myLoop():
channel = client.get_channel(899698630271856640)
await channel.send('1')

要启动一个discord.py循环,必须在on_ready函数下运行它。在函数中增加myLoop.run()