SanYeCao-Nonebot/src/plugins/daily_report.py
SlyAimer efa21d2b5c feat(plugins): 新增日报功能并优化菜单项
- 新增 `daily_report.py` 模块,实现日报功能
- 在 `check.py` 的菜单项中添加 `/日报` 选项
2025-02-14 11:07:50 +08:00

15 lines
563 B
Python

from datetime import datetime
from pathlib import Path
from nonebot.rule import to_me
from nonebot.plugin import on_command
from nonebot.adapters.qq import MessageSegment
from src.clover_report.data_source import Report
from src.configs.path_config import daily_news_path
daily_report = on_command("日报", rule=to_me(), priority=10, block=True)
@daily_report.handle()
async def handle_function():
await Report.get_report_image()
now = datetime.now().date()
await daily_report.finish(MessageSegment.file_image(Path(daily_news_path+f"{now}.png")))