2022-01-04 15:19:59 +08:00
|
|
|
from nonebot.matcher import Matcher
|
2022-09-01 10:41:43 +08:00
|
|
|
from nonebot.permission import USER, Permission
|
2022-01-04 15:19:59 +08:00
|
|
|
|
|
|
|
default_permission = Permission()
|
2023-06-19 17:48:59 +08:00
|
|
|
new_permission = Permission()
|
2022-01-04 15:19:59 +08:00
|
|
|
|
|
|
|
test_permission_updater = Matcher.new(permission=default_permission)
|
|
|
|
|
2022-09-01 10:41:43 +08:00
|
|
|
test_user_permission_updater = Matcher.new(
|
|
|
|
permission=USER("test", perm=default_permission)
|
|
|
|
)
|
|
|
|
|
2022-01-04 15:19:59 +08:00
|
|
|
test_custom_updater = Matcher.new(permission=default_permission)
|
|
|
|
|
|
|
|
|
|
|
|
@test_custom_updater.permission_updater
|
|
|
|
async def _() -> Permission:
|
2023-06-19 17:48:59 +08:00
|
|
|
return new_permission
|