mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-Nonebot.git
synced 2026-04-01 22:04:51 +00:00
今日塔罗提交,并删除冗余文件
This commit is contained in:
parent
e119e9b29e
commit
130b76231a
1 changed files with 6 additions and 3 deletions
|
|
@ -2,10 +2,10 @@
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from nonebot.rule import to_me
|
from nonebot.rule import to_me
|
||||||
from nonebot.plugin import on_command
|
from nonebot.plugin import on_command
|
||||||
from nonebot.adapters.qq import Message, MessageEvent, MessageSegment
|
from nonebot.adapters.qq import Message, MessageEvent, MessageSegment,exception
|
||||||
|
|
||||||
from src.image.get_image import get_image_names
|
from src.image.get_image import get_image_names
|
||||||
from src.my_sqlite.models.fortune import QrFortune,QrFortuneLog
|
from src.my_sqlite.models.fortune import QrFortune,QrFortuneLog
|
||||||
|
from src.my_sqlite.models.tarot import MajorArcana
|
||||||
|
|
||||||
fortune_by_sqlite = on_command("今日运势", rule=to_me(), priority=10, block=True)
|
fortune_by_sqlite = on_command("今日运势", rule=to_me(), priority=10, block=True)
|
||||||
@fortune_by_sqlite.handle()
|
@fortune_by_sqlite.handle()
|
||||||
|
|
@ -32,7 +32,10 @@ async def get_today_fortune(message: MessageEvent):
|
||||||
MessageSegment.file_image(Path(local_image_path)),
|
MessageSegment.file_image(Path(local_image_path)),
|
||||||
MessageSegment.text(content),
|
MessageSegment.text(content),
|
||||||
])
|
])
|
||||||
|
try:
|
||||||
await fortune_by_sqlite.finish(msg)
|
await fortune_by_sqlite.finish(msg)
|
||||||
|
except exception.ActionFailed:
|
||||||
|
await fortune_by_sqlite.finish("您的今日运势被外星人抢走啦,请重试。这绝对不是咱的错,绝对不是!")
|
||||||
|
|
||||||
|
|
||||||
tarot = on_command("今日塔罗", rule=to_me(), priority=10, block=True)
|
tarot = on_command("今日塔罗", rule=to_me(), priority=10, block=True)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue