mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-16 02:50:48 +00:00
📝 update doc
This commit is contained in:
@ -133,75 +133,6 @@ def USER(*user: str, perm: Permission = Permission()):
|
||||
return Permission(_user)
|
||||
|
||||
|
||||
# async def _private(bot: "Bot", event: "Event") -> bool:
|
||||
# return event.get_type() == "message" and event.detail_type == "private"
|
||||
|
||||
# async def _private_friend(bot: "Bot", event: "Event") -> bool:
|
||||
# return (event.get_type() == "message" and event.detail_type == "private" and
|
||||
# event.sub_type == "friend")
|
||||
|
||||
# async def _private_group(bot: "Bot", event: "Event") -> bool:
|
||||
# return (event.get_type() == "message" and event.detail_type == "private" and
|
||||
# event.sub_type == "group")
|
||||
|
||||
# async def _private_other(bot: "Bot", event: "Event") -> bool:
|
||||
# return (event.get_type() == "message" and event.detail_type == "private" and
|
||||
# event.sub_type == "other")
|
||||
|
||||
# PRIVATE = Permission(_private)
|
||||
# """
|
||||
# - **说明**: 匹配任意私聊消息类型事件
|
||||
# """
|
||||
# PRIVATE_FRIEND = Permission(_private_friend)
|
||||
# """
|
||||
# - **说明**: 匹配任意好友私聊消息类型事件
|
||||
# """
|
||||
# PRIVATE_GROUP = Permission(_private_group)
|
||||
# """
|
||||
# - **说明**: 匹配任意群临时私聊消息类型事件
|
||||
# """
|
||||
# PRIVATE_OTHER = Permission(_private_other)
|
||||
# """
|
||||
# - **说明**: 匹配任意其他私聊消息类型事件
|
||||
# """
|
||||
|
||||
# async def _group(bot: "Bot", event: "Event") -> bool:
|
||||
# return event.get_type() == "message" and event.detail_type == "group"
|
||||
|
||||
# async def _group_member(bot: "Bot", event: "Event") -> bool:
|
||||
# return (event.get_type() == "message" and event.detail_type == "group" and
|
||||
# event.sender.get("role") == "member")
|
||||
|
||||
# async def _group_admin(bot: "Bot", event: "Event") -> bool:
|
||||
# return (event.get_type() == "message" and event.detail_type == "group" and
|
||||
# event.sender.get("role") == "admin")
|
||||
|
||||
# async def _group_owner(bot: "Bot", event: "Event") -> bool:
|
||||
# return (event.get_type() == "message" and event.detail_type == "group" and
|
||||
# event.sender.get("role") == "owner")
|
||||
|
||||
# GROUP = Permission(_group)
|
||||
# """
|
||||
# - **说明**: 匹配任意群聊消息类型事件
|
||||
# """
|
||||
# GROUP_MEMBER = Permission(_group_member)
|
||||
# """
|
||||
# - **说明**: 匹配任意群员群聊消息类型事件
|
||||
|
||||
# \:\:\:warning 警告
|
||||
# 该权限通过 event.sender 进行判断且不包含管理员以及群主!
|
||||
# \:\:\:
|
||||
# """
|
||||
# GROUP_ADMIN = Permission(_group_admin)
|
||||
# """
|
||||
# - **说明**: 匹配任意群管理员群聊消息类型事件
|
||||
# """
|
||||
# GROUP_OWNER = Permission(_group_owner)
|
||||
# """
|
||||
# - **说明**: 匹配任意群主群聊消息类型事件
|
||||
# """
|
||||
|
||||
|
||||
async def _superuser(bot: "Bot", event: "Event") -> bool:
|
||||
return event.get_type() == "message" and event.get_user_id(
|
||||
) in bot.config.superusers
|
||||
|
Reference in New Issue
Block a user