Skip to content

Commit

Permalink
优化一些写法
Browse files Browse the repository at this point in the history
  • Loading branch information
MerCuJerry committed Feb 29, 2024
1 parent 2dd07ae commit 9035957
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nonebot_plugin_blocker/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from nonebot.message import run_preprocessor
from nonebot.exception import IgnoredException
import re
from pathlib import Path
from .config import blockerlist, reply_config_raw, reply_config
from fastapi import FastAPI
from . import web
Expand Down Expand Up @@ -91,7 +92,7 @@ async def blocker_msg_handle(
if msg_type == "text": # PEP 634 :(
msg = MessageSegment.text(msg_data)
elif msg_type == "image":
msg = MessageSegment.image(msg_data)
msg = MessageSegment.image(Path(msg_data).read_bytes())
elif msg_type == "record":
msg = MessageSegment.record(msg_data)
msg = MessageSegment.record(Path(msg_data).read_bytes())
await matcher.finish(msg)

0 comments on commit 9035957

Please sign in to comment.