使用扩展程序执行以下操作的方法如下
tasks
from discord.ext import commands, tasksbot = commands.Bot("!")target_channel_id = 1234@tasks.loop(hours=24)async def called_once_a_day(): message_channel = bot.get_channel(target_channel_id) print(f"Got channel {message_channel}") await message_channel.send("Your message")@called_once_a_day.before_loopasync def before(): await bot.wait_until_ready() print("Finished waiting")called_once_a_day.start()bot.run("token")


