(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{510:function(e,t,s){"use strict";s.r(t);var r=s(21),v=Object(r.a)({},(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[s("h1",{attrs:{id:"nonebot-permission-模块"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nonebot-permission-模块"}},[e._v("#")]),e._v(" NoneBot.permission 模块")]),e._v(" "),s("h2",{attrs:{id:"权限"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#权限"}},[e._v("#")]),e._v(" 权限")]),e._v(" "),s("p",[e._v("每个 "),s("code",[e._v("Matcher")]),e._v(" 拥有一个 "),s("code",[e._v("Permission")]),e._v(" ，其中是 "),s("strong",[e._v("异步")]),e._v(" "),s("code",[e._v("PermissionChecker")]),e._v(" 的集合，只要有一个 "),s("code",[e._v("PermissionChecker")]),e._v(" 检查结果为 "),s("code",[e._v("True")]),e._v(" 时就会继续运行。")]),e._v(" "),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[e._v("提示")]),e._v(" "),s("p",[s("code",[e._v("PermissionChecker")]),e._v(" 既可以是 async function 也可以是 sync function")])]),e._v(" "),s("h2",{attrs:{id:"message"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#message"}},[e._v("#")]),e._v(" "),s("code",[e._v("MESSAGE")])]),e._v(" "),s("ul",[s("li",[s("strong",[e._v("说明")]),e._v(": 匹配任意 "),s("code",[e._v("message")]),e._v(" 类型事件，仅在需要同时捕获不同类型事件时使用。优先使用 message type 的 Matcher。")])]),e._v(" "),s("h2",{attrs:{id:"notice"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#notice"}},[e._v("#")]),e._v(" "),s("code",[e._v("NOTICE")])]),e._v(" "),s("ul",[s("li",[s("strong",[e._v("说明")]),e._v(": 匹配任意 "),s("code",[e._v("notice")]),e._v(" 类型事件，仅在需要同时捕获不同类型事件时使用。优先使用 notice type 的 Matcher。")])]),e._v(" "),s("h2",{attrs:{id:"request"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#request"}},[e._v("#")]),e._v(" "),s("code",[e._v("REQUEST")])]),e._v(" "),s("ul",[s("li",[s("strong",[e._v("说明")]),e._v(": 匹配任意 "),s("code",[e._v("request")]),e._v(" 类型事件，仅在需要同时捕获不同类型事件时使用。优先使用 request type 的 Matcher。")])]),e._v(" "),s("h2",{attrs:{id:"metaevent"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#metaevent"}},[e._v("#")]),e._v(" "),s("code",[e._v("METAEVENT")])]),e._v(" "),s("ul",[s("li",[s("strong",[e._v("说明")]),e._v(": 匹配任意 "),s("code",[e._v("meta_event")]),e._v(" 类型事件，仅在需要同时捕获不同类型事件时使用。优先使用 meta_event type 的 Matcher。")])]),e._v(" "),s("h2",{attrs:{id:"user-user-perm-nonebot-permission-permission-object"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#user-user-perm-nonebot-permission-permission-object"}},[e._v("#")]),e._v(" "),s("code",[e._v("USER(*user, perm=<nonebot.permission.Permission object>)")])]),e._v(" "),s("ul",[s("li",[s("p",[s("strong",[e._v("说明")])]),e._v(" "),s("p",[e._v("在白名单内且满足 perm")])]),e._v(" "),s("li",[s("p",[s("strong",[e._v("参数")])]),e._v(" "),s("ul",[s("li",[s("p",[s("code",[e._v("*user: str")]),e._v(": 白名单")])]),e._v(" "),s("li",[s("p",[s("code",[e._v("perm: Permission")]),e._v(": 需要同时满足的权限")])])])])]),e._v(" "),s("h2",{attrs:{id:"superuser"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#superuser"}},[e._v("#")]),e._v(" "),s("code",[e._v("SUPERUSER")])]),e._v(" "),s("ul",[s("li",[s("strong",[e._v("说明")]),e._v(": 匹配任意超级用户消息类型事件")])])])}),[],!1,null,null,null);t.default=v.exports}}]);