我想让我的机器人能够以自定义循环时间在循环中发送消息 例如!提醒60秒将使机器人在60秒内发出提醒 例如!提醒23秒将使机器人在23秒内发出提醒
我现在有这个,但不起作用。 如果您能提供一个很好的例子,我们将不胜感激。谢谢
@tasks.loop(seconds=timeP)
async def Reminder():
timeP = 5
channel = client.get_channel(717689495620681731)
await client.change_presence(activity=discord.Game('online'))
print('test')
await channel.send('<@&717696163574186026> here')
您可以使用discord.py中的
task
装饰器:相关问题 更多 >
编程相关推荐