mirror of
https://github.com/Genshin-bots/gsuid_core.git
synced 2025-05-12 06:55:49 +08:00
🐛 修复command_start
的BUG
This commit is contained in:
parent
13b240090e
commit
29d15bdcee
@ -94,12 +94,14 @@ 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:
|
||||||
|
if not is_start:
|
||||||
return
|
return
|
||||||
|
|
||||||
valid_event: Dict[Trigger, int] = {}
|
valid_event: Dict[Trigger, int] = {}
|
||||||
|
@ -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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user