🐛 修复command_start的BUG

This commit is contained in:
KimigaiiWuyi 2023-11-23 03:26:41 +08:00
parent 13b240090e
commit 29d15bdcee
2 changed files with 7 additions and 3 deletions

View File

@ -94,13 +94,15 @@ async def handle_event(ws: _Bot, msg: MessageReceive):
instances[uuid].set_event() instances[uuid].set_event()
return return
is_start = False
if command_start and event.raw_text: if command_start and event.raw_text:
for start in command_start: for start in command_start:
if event.raw_text.strip().startswith(start): if event.raw_text.strip().startswith(start):
event.raw_text = event.raw_text.replace(start, '') event.raw_text = event.raw_text.replace(start, '', 1)
break is_start = True
else: else:
return if not is_start:
return
valid_event: Dict[Trigger, int] = {} valid_event: Dict[Trigger, int] = {}
pending = [ pending = [

View File

@ -207,6 +207,8 @@ async def _convert_message_to_image(
if isinstance(img, str) and img.startswith('base64://'): if isinstance(img, str) and img.startswith('base64://'):
image_b64 = img image_b64 = img
image_bytes = b64decode(img[9:]) image_bytes = b64decode(img[9:])
elif isinstance(img, str) and img.startswith('link://'):
return [Message(type='image', data=img)]
else: else:
image_bytes = img image_bytes = img
else: else: