使用扩展程序执行以下 *** 作的方法如下
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")
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)