mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-09-01 01:26:46 +00:00
22 lines
336 B
Python
22 lines
336 B
Python
from typing import Annotated
|
|
|
|
from nonebot import on_message
|
|
from nonebot.params import Depends
|
|
|
|
test_depends = on_message()
|
|
|
|
runned = []
|
|
|
|
|
|
def dependency():
|
|
runned.append(1)
|
|
return 1
|
|
|
|
|
|
type AliasedDepends = Annotated[int, Depends(dependency)]
|
|
|
|
|
|
@test_depends.handle()
|
|
async def aliased_depends(x: AliasedDepends):
|
|
return x
|