mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 00:55:07 +08:00
📝 update docstring
This commit is contained in:
parent
0d8e51ff3f
commit
98b67ad829
@ -215,7 +215,7 @@ Rule(async_function, run_sync(sync_function))
|
||||
from nonebot.rule import ArgumentParser
|
||||
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument("-a", type=bool)
|
||||
parser.add_argument("-a", action="store_true")
|
||||
|
||||
rule = shell_command("ls", parser=parser)
|
||||
```
|
||||
|
@ -53,6 +53,12 @@ class ParserExit(NoneBotException):
|
||||
self.status = status
|
||||
self.message = message
|
||||
|
||||
def __repr__(self):
|
||||
return f"<ParserExit status={self.status} message={self.message}>"
|
||||
|
||||
def __str__(self):
|
||||
return self.__repr__()
|
||||
|
||||
|
||||
class PausedException(NoneBotException):
|
||||
"""
|
||||
|
@ -326,7 +326,7 @@ def shell_command(*cmds: Union[str, Tuple[str, ...]],
|
||||
from nonebot.rule import ArgumentParser
|
||||
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument("-a", type=bool)
|
||||
parser.add_argument("-a", action="store_true")
|
||||
|
||||
rule = shell_command("ls", parser=parser)
|
||||
|
||||
|
@ -4,7 +4,7 @@ from nonebot import on_shell_command
|
||||
from nonebot.rule import to_me, ArgumentParser
|
||||
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument("-a", type=bool)
|
||||
parser.add_argument("-a", action="store_true")
|
||||
|
||||
shell = on_shell_command("ls", to_me(), parser=parser)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user