Skip to content

Commit 95ef065

Browse files
committed
fixoiiaoii
1 parent a9bfa9d commit 95ef065

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

nonebot_plugin_maimaimonitor/maimai_plugin_v11.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from nonebot.matcher import Matcher
66
from nonebot.adapters.onebot.v11 import Bot, Event, Message # V11 imports
77
from nonebot.params import CommandArg
8+
import asyncio # New import
89
from nonebot import get_plugin_config
910
from .config import Config
1011

@@ -21,7 +22,7 @@
2122
report_cache: defaultdict[int, list[int]] = defaultdict(list)
2223
cache_lock = Lock()
2324

24-
report_matcher = on_command("report", aliases={"上报"}, priority=5, block=True)
25+
report_matcher = on_command("report", aliases={"上报"}, priority=5, block=False)
2526

2627
@report_matcher.handle()
2728
async def handle_report(bot: Bot, event: Event, args: Message = CommandArg()):
@@ -90,7 +91,8 @@ async def send_aggregated_reports():
9091

9192
try:
9293
print("--- Sending aggregated bot report... ---")
93-
reporter.send_report(final_payload, custom_display_name=config.maimai_bot_display_name)
94+
loop = asyncio.get_event_loop()
95+
await loop.run_in_executor(None, reporter.send_report, final_payload, config.maimai_bot_display_name)
9496
except Exception as e:
9597
print(f"Error sending aggregated report: {e}")
9698

0 commit comments

Comments
 (0)