mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-27 16:21:28 +00:00
Update demo
This commit is contained in:
@ -2,16 +2,17 @@ from none import (
|
||||
CommandSession, CommandGroup,
|
||||
on_natural_language, NLPSession, NLPResult
|
||||
)
|
||||
from none.helpers import render_expression as __
|
||||
|
||||
from . import expressions as expr
|
||||
from . import expressions as e
|
||||
|
||||
w = CommandGroup('weather')
|
||||
|
||||
|
||||
@w.command('weather', aliases=('天气', '天气预报'))
|
||||
async def weather(session: CommandSession):
|
||||
city = session.get('city', prompt_expr=expr.WHICH_CITY)
|
||||
await session.send_expr(expr.REPORT, city=city)
|
||||
city = session.get('city', prompt=__(e.WHICH_CITY))
|
||||
await session.send(__(e.REPORT, city=city))
|
||||
|
||||
|
||||
@weather.args_parser
|
||||
|
Reference in New Issue
Block a user