mirror of
https://github.com/Genshin-bots/gsuid_core.git
synced 2025-05-12 06:55:49 +08:00
🎨 为Bot.receive_resp()
添加更多参数
This commit is contained in:
parent
1de7d77525
commit
3a93b06a76
@ -139,7 +139,9 @@ class Bot:
|
|||||||
] = None,
|
] = None,
|
||||||
unsuported_platform: bool = False,
|
unsuported_platform: bool = False,
|
||||||
timeout: float = 60,
|
timeout: float = 60,
|
||||||
sep: str = ' / ',
|
sep: str = '\n',
|
||||||
|
command_tips: str = '请输入以下命令之一:',
|
||||||
|
command_start_text: str = '',
|
||||||
):
|
):
|
||||||
return await self.receive_resp(
|
return await self.receive_resp(
|
||||||
reply,
|
reply,
|
||||||
@ -149,6 +151,8 @@ class Bot:
|
|||||||
True,
|
True,
|
||||||
timeout,
|
timeout,
|
||||||
sep=sep,
|
sep=sep,
|
||||||
|
command_tips=command_tips,
|
||||||
|
command_start_text=command_start_text,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def send_option(
|
async def send_option(
|
||||||
@ -160,10 +164,19 @@ class Bot:
|
|||||||
Union[List[str], List[Button], List[List[str]], List[List[Button]]]
|
Union[List[str], List[Button], List[List[str]], List[List[Button]]]
|
||||||
] = None,
|
] = None,
|
||||||
unsuported_platform: bool = False,
|
unsuported_platform: bool = False,
|
||||||
sep: str = ' / ',
|
sep: str = '\n',
|
||||||
|
command_tips: str = '请输入以下命令之一:',
|
||||||
|
command_start_text: str = '',
|
||||||
):
|
):
|
||||||
return await self.receive_resp(
|
return await self.receive_resp(
|
||||||
reply, option_list, unsuported_platform, False, False, sep=sep
|
reply,
|
||||||
|
option_list,
|
||||||
|
unsuported_platform,
|
||||||
|
False,
|
||||||
|
False,
|
||||||
|
sep=sep,
|
||||||
|
command_tips=command_tips,
|
||||||
|
command_start_text=command_start_text,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def receive_resp(
|
async def receive_resp(
|
||||||
@ -178,7 +191,9 @@ class Bot:
|
|||||||
is_mutiply: bool = False,
|
is_mutiply: bool = False,
|
||||||
is_recive: bool = True,
|
is_recive: bool = True,
|
||||||
timeout: float = 60,
|
timeout: float = 60,
|
||||||
sep: str = ' / ',
|
sep: str = '\n',
|
||||||
|
command_tips: str = '请输入以下命令之一:',
|
||||||
|
command_start_text: str = '',
|
||||||
) -> Optional[Event]:
|
) -> Optional[Event]:
|
||||||
if option_list:
|
if option_list:
|
||||||
if reply is None:
|
if reply is None:
|
||||||
@ -249,7 +264,12 @@ class Bot:
|
|||||||
_options.append(option)
|
_options.append(option)
|
||||||
|
|
||||||
_reply.append(
|
_reply.append(
|
||||||
MessageSegment.text('\n请输入以下命令之一:\n' + sep.join(_options))
|
MessageSegment.text(
|
||||||
|
f'\n{command_tips}\n'
|
||||||
|
+ sep.join(
|
||||||
|
[f'{command_start_text}{op}' for op in _options]
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
await self.send(_reply)
|
await self.send(_reply)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user