mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 16:16:21 +08:00
16 lines
379 B
Python
16 lines
379 B
Python
|
from nonebot.adapters import Bot
|
||
|
from nonebot.typing import T_State
|
||
|
from nonebot import on_shell_command
|
||
|
from nonebot.rule import to_me, ArgumentParser
|
||
|
|
||
|
parser = ArgumentParser()
|
||
|
parser.add_argument("-a", type=bool)
|
||
|
|
||
|
shell = on_shell_command("ls", to_me(), parser=parser)
|
||
|
|
||
|
|
||
|
@shell.handle()
|
||
|
async def _(bot: Bot, state: T_State):
|
||
|
print(state["argv"])
|
||
|
print(state["args"])
|