mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 00:55:07 +08:00
修复从酷 Q 收到的消息的换行问题(正确处理 \r\n)
This commit is contained in:
parent
69eae5197e
commit
2a9e5e7f81
@ -28,7 +28,7 @@ _scheduler = BackgroundScheduler(
|
||||
|
||||
_command_args_start_flags = get_command_args_start_flags()
|
||||
|
||||
_args_split_sep = '[ \n\t]'
|
||||
_args_split_sep = ' |\r?\n|\t'
|
||||
_job_id_suffix_start = '@'
|
||||
|
||||
|
||||
@ -152,7 +152,7 @@ def add_job(args_text, ctx_msg, internal=False):
|
||||
job_id = job_id_without_suffix + _job_id_suffix_start + get_target(ctx_msg)
|
||||
command_list = []
|
||||
if multi:
|
||||
command_raw_list = command_raw.split('\n')
|
||||
command_raw_list = re.split('\r?\n', command_raw)
|
||||
for cmd_raw in command_raw_list:
|
||||
cmd_raw = cmd_raw.lstrip()
|
||||
if not cmd_raw:
|
||||
|
Loading…
Reference in New Issue
Block a user