mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-16 02:50:48 +00:00
✨ Feature: 添加多消息段命令解析支持 (#2419)
Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
This commit is contained in:
@ -117,6 +117,11 @@ class TrieRule:
|
||||
# check whitespace
|
||||
arg_str = segment_text[len(pf.key) :]
|
||||
arg_str_stripped = arg_str.lstrip()
|
||||
# check next segment until arg detected or no text remain
|
||||
while not arg_str_stripped and msg and msg[0].is_text():
|
||||
arg_str += str(msg.pop(0))
|
||||
arg_str_stripped = arg_str.lstrip()
|
||||
|
||||
has_arg = arg_str_stripped or msg
|
||||
if (
|
||||
has_arg
|
||||
|
Reference in New Issue
Block a user