🐛 修复Bug

This commit is contained in:
KimigaiiWuyi 2023-10-04 01:37:50 +08:00
parent 2c36ff7397
commit f1c18bd62b
2 changed files with 3 additions and 3 deletions

View File

@ -123,7 +123,7 @@ class Bot:
_reply = await convert_message(reply) _reply = await convert_message(reply)
if self.ev.real_bot_id in ['qqguild', 'qqgroup']: if self.ev.real_bot_id in ['qqgroup']:
_reply_str = await to_markdown(_reply) _reply_str = await to_markdown(_reply)
_buttons: List[Button] = [] _buttons: List[Button] = []
for option in option_list: for option in option_list:

View File

@ -2,7 +2,7 @@ import uuid
import random import random
from io import BytesIO from io import BytesIO
from pathlib import Path from pathlib import Path
from base64 import b64encode from base64 import b64decode, b64encode
from typing import List, Tuple, Union, Literal, Optional from typing import List, Tuple, Union, Literal, Optional
import msgspec import msgspec
@ -152,7 +152,7 @@ async def convert_message(
message = [message] message = [message]
elif isinstance(message, str): elif isinstance(message, str):
if message.startswith('base64://'): if message.startswith('base64://'):
img = Image.open(message) img = Image.open(BytesIO(b64decode(message[9:])))
message = [ message = [
MessageSegment.image(message), MessageSegment.image(message),
MessageSegment.image_size(img.size), MessageSegment.image_size(img.size),