refactor: onmyoji gacha plugin overhaul (gacha-refactor)
This commit is contained in:
25
danding_bot/plugins/onmyoji_gacha/handlers/daily_stats.py
Normal file
25
danding_bot/plugins/onmyoji_gacha/handlers/daily_stats.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""
|
||||
今日抽卡统计处理模块
|
||||
|
||||
处理今日抽卡统计查询命令。
|
||||
"""
|
||||
|
||||
from nonebot.adapters.onebot.v11 import Bot, MessageEvent, GroupMessageEvent
|
||||
import nonebot
|
||||
|
||||
from ..utils import get_gacha_system
|
||||
from .. import formatters
|
||||
|
||||
logger = nonebot.logger
|
||||
|
||||
|
||||
async def handle_daily_stats(bot: Bot, event: MessageEvent, state: dict):
|
||||
"""处理今日抽卡统计命令"""
|
||||
gacha_system = get_gacha_system()
|
||||
daily_stats = await gacha_system.get_daily_stats()
|
||||
|
||||
if not daily_stats or daily_stats.get("today_total", 0) == 0:
|
||||
await event.finish("今日暂无抽卡记录")
|
||||
|
||||
msg = formatters.format_daily_stats(daily_stats)
|
||||
await event.send(msg)
|
||||
Reference in New Issue
Block a user