问题描述
我收到此错误:
tuesday_lunch_time = arrow.get("1230","HHmm")
#loop every minute so we are within a minute of lunch time.. you Could change this to loop more often
@tasks.loop(minutes=1)
async def called_once_a_day():
Now = arrow.Now()
if Now.weekday()== 1: #is today tuesday,don't ask me why tuesday is 1
if tuesday_lunch_time.shift(minutes=2).time() > Now.time > tuesday_lunch_time.time(): ###this checks if you are within two minutes after lunch time,you Could change this if you want to say have it be early,because of our loop it should be within a minute but I picked two minutes to be safe
message_channel = client.get_channel(target_channel_id)
print(f"Got channel {message_channel}")
await message_channel.send(random.choice(list_warning))
#to get out of the conditional above,so you don't send multiple times
await asyncio.sleep(720)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)