diff --git a/gsuid_core/bot.py b/gsuid_core/bot.py index 4b7d6ff..386dd36 100644 --- a/gsuid_core/bot.py +++ b/gsuid_core/bot.py @@ -123,7 +123,7 @@ class Bot: _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) _buttons: List[Button] = [] for option in option_list: diff --git a/gsuid_core/segment.py b/gsuid_core/segment.py index 14685ed..695812d 100644 --- a/gsuid_core/segment.py +++ b/gsuid_core/segment.py @@ -2,7 +2,7 @@ import uuid import random from io import BytesIO from pathlib import Path -from base64 import b64encode +from base64 import b64decode, b64encode from typing import List, Tuple, Union, Literal, Optional import msgspec @@ -152,7 +152,7 @@ async def convert_message( message = [message] elif isinstance(message, str): if message.startswith('base64://'): - img = Image.open(message) + img = Image.open(BytesIO(b64decode(message[9:]))) message = [ MessageSegment.image(message), MessageSegment.image_size(img.size),