Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] RemindEvent 事件 提醒时间异常 #10

Closed
luxuncang opened this issue Feb 10, 2022 · 0 comments
Closed

[Bug] RemindEvent 事件 提醒时间异常 #10

luxuncang opened this issue Feb 10, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@luxuncang
Copy link
Owner

await asyncio.sleep(res.seconds)
await session.send(MessageChain.create([Plain(text[-1])]))
elif text[0] == '-w':
if len(text[1:-1]) == 1:
res = text[1].split(':')
if len(res) == 3:
date = datetime.strptime(text[1], '%H:%M:%S')
await session.send(MessageChain.create([Plain('还有{}小时{}分钟{}秒 提醒!'.format(date.hour, date.minute, date.second))]))
elif len(res) == 2:
date = datetime.strptime(text[1], '%M:%S')
await session.send(MessageChain.create([Plain('还有{}分钟{}秒 提醒!'.format(date.minute, date.second))]))
elif len(res) == 1:
date = datetime.strptime(text[1], '%S')
await session.send(MessageChain.create([Plain('还有{}秒 提醒!'.format(date.second))]))
else:
await session.send(MessageChain.create([Plain('提醒格式错误')]))
return False
await asyncio.sleep(date.second)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant