mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-27 08:11:38 +00:00
🏷️ update pyi files
This commit is contained in:
@ -18,7 +18,7 @@ def log(level: str, message: str):
|
|||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
def escape(s: str, *, escape_comma: bool = True) -> str:
|
def escape(s: str, *, escape_comma: bool = ...) -> str:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -128,8 +128,8 @@ class Bot(BaseBot):
|
|||||||
*,
|
*,
|
||||||
user_id: int,
|
user_id: int,
|
||||||
message: Union[str, Message],
|
message: Union[str, Message],
|
||||||
auto_escape: bool = False,
|
auto_escape: bool = ...,
|
||||||
self_id: Optional[int] = None) -> Dict[str, Any]:
|
self_id: Optional[int] = ...) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -148,8 +148,8 @@ class Bot(BaseBot):
|
|||||||
*,
|
*,
|
||||||
group_id: int,
|
group_id: int,
|
||||||
message: Union[str, Message],
|
message: Union[str, Message],
|
||||||
auto_escape: bool = False,
|
auto_escape: bool = ...,
|
||||||
self_id: Optional[int] = None) -> Dict[str, Any]:
|
self_id: Optional[int] = ...) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -166,12 +166,12 @@ class Bot(BaseBot):
|
|||||||
|
|
||||||
async def send_msg(self,
|
async def send_msg(self,
|
||||||
*,
|
*,
|
||||||
message_type: Optional[str] = None,
|
message_type: Optional[str] = ...,
|
||||||
user_id: Optional[int] = None,
|
user_id: Optional[int] = ...,
|
||||||
group_id: Optional[int] = None,
|
group_id: Optional[int] = ...,
|
||||||
message: Union[str, Message],
|
message: Union[str, Message],
|
||||||
auto_escape: bool = False,
|
auto_escape: bool = ...,
|
||||||
self_id: Optional[int] = None) -> Dict[str, Any]:
|
self_id: Optional[int] = ...) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ class Bot(BaseBot):
|
|||||||
async def delete_msg(self,
|
async def delete_msg(self,
|
||||||
*,
|
*,
|
||||||
message_id: int,
|
message_id: int,
|
||||||
self_id: Optional[int] = None) -> None:
|
self_id: Optional[int] = ...) -> None:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -207,7 +207,7 @@ class Bot(BaseBot):
|
|||||||
async def get_msg(self,
|
async def get_msg(self,
|
||||||
*,
|
*,
|
||||||
message_id: int,
|
message_id: int,
|
||||||
self_id: Optional[int] = None) -> Dict[str, Any]:
|
self_id: Optional[int] = ...) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ class Bot(BaseBot):
|
|||||||
async def get_forward_msg(self,
|
async def get_forward_msg(self,
|
||||||
*,
|
*,
|
||||||
id: int,
|
id: int,
|
||||||
self_id: Optional[int] = None) -> None:
|
self_id: Optional[int] = ...) -> None:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -239,8 +239,8 @@ class Bot(BaseBot):
|
|||||||
async def send_like(self,
|
async def send_like(self,
|
||||||
*,
|
*,
|
||||||
user_id: int,
|
user_id: int,
|
||||||
times: int = 1,
|
times: int = ...,
|
||||||
self_id: Optional[int] = None) -> None:
|
self_id: Optional[int] = ...) -> None:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -258,8 +258,8 @@ class Bot(BaseBot):
|
|||||||
*,
|
*,
|
||||||
group_id: int,
|
group_id: int,
|
||||||
user_id: int,
|
user_id: int,
|
||||||
reject_add_request: bool = False,
|
reject_add_request: bool = ...,
|
||||||
self_id: Optional[int] = None) -> None:
|
self_id: Optional[int] = ...) -> None:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -278,8 +278,8 @@ class Bot(BaseBot):
|
|||||||
*,
|
*,
|
||||||
group_id: int,
|
group_id: int,
|
||||||
user_id: int,
|
user_id: int,
|
||||||
duration: int = 30 * 60,
|
duration: int = ...,
|
||||||
self_id: Optional[int] = None) -> None:
|
self_id: Optional[int] = ...) -> None:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -297,11 +297,10 @@ class Bot(BaseBot):
|
|||||||
async def set_group_anonymous_ban(self,
|
async def set_group_anonymous_ban(self,
|
||||||
*,
|
*,
|
||||||
group_id: int,
|
group_id: int,
|
||||||
anonymous: Optional[Dict[str,
|
anonymous: Optional[Dict[str, Any]] = ...,
|
||||||
Any]] = None,
|
anonymous_flag: Optional[str] = ...,
|
||||||
anonymous_flag: Optional[str] = None,
|
duration: int = ...,
|
||||||
duration: int = 30 * 60,
|
self_id: Optional[int] = ...) -> None:
|
||||||
self_id: Optional[int] = None) -> None:
|
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -320,8 +319,8 @@ class Bot(BaseBot):
|
|||||||
async def set_group_whole_ban(self,
|
async def set_group_whole_ban(self,
|
||||||
*,
|
*,
|
||||||
group_id: int,
|
group_id: int,
|
||||||
enable: bool = True,
|
enable: bool = ...,
|
||||||
self_id: Optional[int] = None) -> None:
|
self_id: Optional[int] = ...) -> None:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -339,8 +338,8 @@ class Bot(BaseBot):
|
|||||||
*,
|
*,
|
||||||
group_id: int,
|
group_id: int,
|
||||||
user_id: int,
|
user_id: int,
|
||||||
enable: bool = True,
|
enable: bool = ...,
|
||||||
self_id: Optional[int] = None) -> None:
|
self_id: Optional[int] = ...) -> None:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -358,8 +357,8 @@ class Bot(BaseBot):
|
|||||||
async def set_group_anonymous(self,
|
async def set_group_anonymous(self,
|
||||||
*,
|
*,
|
||||||
group_id: int,
|
group_id: int,
|
||||||
enable: bool = True,
|
enable: bool = ...,
|
||||||
self_id: Optional[int] = None) -> None:
|
self_id: Optional[int] = ...) -> None:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -377,8 +376,8 @@ class Bot(BaseBot):
|
|||||||
*,
|
*,
|
||||||
group_id: int,
|
group_id: int,
|
||||||
user_id: int,
|
user_id: int,
|
||||||
card: str = "",
|
card: str = ...,
|
||||||
self_id: Optional[int] = None) -> None:
|
self_id: Optional[int] = ...) -> None:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -397,7 +396,7 @@ class Bot(BaseBot):
|
|||||||
*,
|
*,
|
||||||
group_id: int,
|
group_id: int,
|
||||||
group_name: str,
|
group_name: str,
|
||||||
self_id: Optional[int] = None) -> None:
|
self_id: Optional[int] = ...) -> None:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -414,8 +413,8 @@ class Bot(BaseBot):
|
|||||||
async def set_group_leave(self,
|
async def set_group_leave(self,
|
||||||
*,
|
*,
|
||||||
group_id: int,
|
group_id: int,
|
||||||
is_dismiss: bool = False,
|
is_dismiss: bool = ...,
|
||||||
self_id: Optional[int] = None) -> None:
|
self_id: Optional[int] = ...) -> None:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -433,9 +432,9 @@ class Bot(BaseBot):
|
|||||||
*,
|
*,
|
||||||
group_id: int,
|
group_id: int,
|
||||||
user_id: int,
|
user_id: int,
|
||||||
special_title: str = "",
|
special_title: str = ...,
|
||||||
duration: int = -1,
|
duration: int = ...,
|
||||||
self_id: Optional[int] = None) -> None:
|
self_id: Optional[int] = ...) -> None:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -454,9 +453,9 @@ class Bot(BaseBot):
|
|||||||
async def set_friend_add_request(self,
|
async def set_friend_add_request(self,
|
||||||
*,
|
*,
|
||||||
flag: str,
|
flag: str,
|
||||||
approve: bool = True,
|
approve: bool = ...,
|
||||||
remark: str = "",
|
remark: str = ...,
|
||||||
self_id: Optional[int] = None) -> None:
|
self_id: Optional[int] = ...) -> None:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -475,9 +474,9 @@ class Bot(BaseBot):
|
|||||||
*,
|
*,
|
||||||
flag: str,
|
flag: str,
|
||||||
sub_type: str,
|
sub_type: str,
|
||||||
approve: bool = True,
|
approve: bool = ...,
|
||||||
reason: str = "",
|
reason: str = ...,
|
||||||
self_id: Optional[int] = None) -> None:
|
self_id: Optional[int] = ...) -> None:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -495,7 +494,7 @@ class Bot(BaseBot):
|
|||||||
|
|
||||||
async def get_login_info(self,
|
async def get_login_info(self,
|
||||||
*,
|
*,
|
||||||
self_id: Optional[int] = None) -> Dict[str, Any]:
|
self_id: Optional[int] = ...) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -507,12 +506,11 @@ class Bot(BaseBot):
|
|||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
async def get_stranger_info(
|
async def get_stranger_info(self,
|
||||||
self,
|
*,
|
||||||
*,
|
user_id: int,
|
||||||
user_id: int,
|
no_cache: bool = ...,
|
||||||
no_cache: bool = False,
|
self_id: Optional[int] = ...) -> Dict[str, Any]:
|
||||||
self_id: Optional[int] = None) -> Dict[str, Any]:
|
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -528,7 +526,7 @@ class Bot(BaseBot):
|
|||||||
|
|
||||||
async def get_friend_list(self,
|
async def get_friend_list(self,
|
||||||
*,
|
*,
|
||||||
self_id: Optional[int] = None
|
self_id: Optional[int] = ...
|
||||||
) -> List[Dict[str, Any]]:
|
) -> List[Dict[str, Any]]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
@ -544,8 +542,8 @@ class Bot(BaseBot):
|
|||||||
async def get_group_info(self,
|
async def get_group_info(self,
|
||||||
*,
|
*,
|
||||||
group_id: int,
|
group_id: int,
|
||||||
no_cache: bool = False,
|
no_cache: bool = ...,
|
||||||
self_id: Optional[int] = None) -> Dict[str, Any]:
|
self_id: Optional[int] = ...) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -561,7 +559,7 @@ class Bot(BaseBot):
|
|||||||
|
|
||||||
async def get_group_list(self,
|
async def get_group_list(self,
|
||||||
*,
|
*,
|
||||||
self_id: Optional[int] = None
|
self_id: Optional[int] = ...
|
||||||
) -> List[Dict[str, Any]]:
|
) -> List[Dict[str, Any]]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
@ -579,8 +577,8 @@ class Bot(BaseBot):
|
|||||||
*,
|
*,
|
||||||
group_id: int,
|
group_id: int,
|
||||||
user_id: int,
|
user_id: int,
|
||||||
no_cache: bool = False,
|
no_cache: bool = ...,
|
||||||
self_id: Optional[int] = None) -> Dict[str, Any]:
|
self_id: Optional[int] = ...) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -599,7 +597,7 @@ class Bot(BaseBot):
|
|||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
group_id: int,
|
group_id: int,
|
||||||
self_id: Optional[int] = None) -> List[Dict[str, Any]]:
|
self_id: Optional[int] = ...) -> List[Dict[str, Any]]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -612,12 +610,12 @@ class Bot(BaseBot):
|
|||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
async def get_group_honor_info(
|
async def get_group_honor_info(self,
|
||||||
self,
|
*,
|
||||||
*,
|
group_id: int,
|
||||||
group_id: int,
|
type: str = ...,
|
||||||
type: str = "all",
|
self_id: Optional[int] = ...
|
||||||
self_id: Optional[int] = None) -> Dict[str, Any]:
|
) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -633,8 +631,8 @@ class Bot(BaseBot):
|
|||||||
|
|
||||||
async def get_cookies(self,
|
async def get_cookies(self,
|
||||||
*,
|
*,
|
||||||
domain: str = "",
|
domain: str = ...,
|
||||||
self_id: Optional[int] = None) -> Dict[str, Any]:
|
self_id: Optional[int] = ...) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -649,7 +647,7 @@ class Bot(BaseBot):
|
|||||||
|
|
||||||
async def get_csrf_token(self,
|
async def get_csrf_token(self,
|
||||||
*,
|
*,
|
||||||
self_id: Optional[int] = None) -> Dict[str, Any]:
|
self_id: Optional[int] = ...) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -663,8 +661,8 @@ class Bot(BaseBot):
|
|||||||
|
|
||||||
async def get_credentials(self,
|
async def get_credentials(self,
|
||||||
*,
|
*,
|
||||||
domain: str = "",
|
domain: str = ...,
|
||||||
self_id: Optional[int] = None) -> Dict[str, Any]:
|
self_id: Optional[int] = ...) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -681,7 +679,7 @@ class Bot(BaseBot):
|
|||||||
*,
|
*,
|
||||||
file: str,
|
file: str,
|
||||||
out_format: str,
|
out_format: str,
|
||||||
self_id: Optional[int] = None) -> Dict[str, Any]:
|
self_id: Optional[int] = ...) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -698,7 +696,7 @@ class Bot(BaseBot):
|
|||||||
async def get_image(self,
|
async def get_image(self,
|
||||||
*,
|
*,
|
||||||
file: str,
|
file: str,
|
||||||
self_id: Optional[int] = None) -> Dict[str, Any]:
|
self_id: Optional[int] = ...) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -713,7 +711,7 @@ class Bot(BaseBot):
|
|||||||
|
|
||||||
async def can_send_image(self,
|
async def can_send_image(self,
|
||||||
*,
|
*,
|
||||||
self_id: Optional[int] = None) -> Dict[str, Any]:
|
self_id: Optional[int] = ...) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -727,7 +725,7 @@ class Bot(BaseBot):
|
|||||||
|
|
||||||
async def can_send_record(self,
|
async def can_send_record(self,
|
||||||
*,
|
*,
|
||||||
self_id: Optional[int] = None) -> Dict[str, Any]:
|
self_id: Optional[int] = ...) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -741,7 +739,7 @@ class Bot(BaseBot):
|
|||||||
|
|
||||||
async def get_status(self,
|
async def get_status(self,
|
||||||
*,
|
*,
|
||||||
self_id: Optional[int] = None) -> Dict[str, Any]:
|
self_id: Optional[int] = ...) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -755,7 +753,7 @@ class Bot(BaseBot):
|
|||||||
|
|
||||||
async def get_version_info(self,
|
async def get_version_info(self,
|
||||||
*,
|
*,
|
||||||
self_id: Optional[int] = None) -> Dict[str, Any]:
|
self_id: Optional[int] = ...) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -769,8 +767,8 @@ class Bot(BaseBot):
|
|||||||
|
|
||||||
async def set_restart(self,
|
async def set_restart(self,
|
||||||
*,
|
*,
|
||||||
delay: int = 0,
|
delay: int = ...,
|
||||||
self_id: Optional[int] = None) -> None:
|
self_id: Optional[int] = ...) -> None:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -783,7 +781,7 @@ class Bot(BaseBot):
|
|||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
async def clean_cache(self, *, self_id: Optional[int] = None) -> None:
|
async def clean_cache(self, *, self_id: Optional[int] = ...) -> None:
|
||||||
"""
|
"""
|
||||||
:说明:
|
:说明:
|
||||||
|
|
||||||
@ -914,7 +912,7 @@ class MessageSegment:
|
|||||||
...
|
...
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def anonymous(ignore_failure: Optional[bool] = None) -> "MessageSegment":
|
def anonymous(ignore_failure: Optional[bool] = ...) -> "MessageSegment":
|
||||||
...
|
...
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -943,10 +941,10 @@ class MessageSegment:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def image(file: str,
|
def image(file: str,
|
||||||
type_: Optional[str] = None,
|
type_: Optional[str] = ...,
|
||||||
cache: bool = True,
|
cache: bool = ...,
|
||||||
proxy: bool = True,
|
proxy: bool = ...,
|
||||||
timeout: Optional[int] = None) -> "MessageSegment":
|
timeout: Optional[int] = ...) -> "MessageSegment":
|
||||||
...
|
...
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -956,8 +954,8 @@ class MessageSegment:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def location(latitude: float,
|
def location(latitude: float,
|
||||||
longitude: float,
|
longitude: float,
|
||||||
title: Optional[str] = None,
|
title: Optional[str] = ...,
|
||||||
content: Optional[str] = None) -> "MessageSegment":
|
content: Optional[str] = ...) -> "MessageSegment":
|
||||||
...
|
...
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -968,8 +966,8 @@ class MessageSegment:
|
|||||||
def music_custom(url: str,
|
def music_custom(url: str,
|
||||||
audio: str,
|
audio: str,
|
||||||
title: str,
|
title: str,
|
||||||
content: Optional[str] = None,
|
content: Optional[str] = ...,
|
||||||
img_url: Optional[str] = None) -> "MessageSegment":
|
img_url: Optional[str] = ...) -> "MessageSegment":
|
||||||
...
|
...
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -987,10 +985,10 @@ class MessageSegment:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def record(file: str,
|
def record(file: str,
|
||||||
magic: Optional[bool] = None,
|
magic: Optional[bool] = ...,
|
||||||
cache: Optional[bool] = None,
|
cache: Optional[bool] = ...,
|
||||||
proxy: Optional[bool] = None,
|
proxy: Optional[bool] = ...,
|
||||||
timeout: Optional[int] = None) -> "MessageSegment":
|
timeout: Optional[int] = ...) -> "MessageSegment":
|
||||||
...
|
...
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -1006,10 +1004,10 @@ class MessageSegment:
|
|||||||
...
|
...
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def share(url: str = "",
|
def share(url: str = ...,
|
||||||
title: str = "",
|
title: str = ...,
|
||||||
content: Optional[str] = None,
|
content: Optional[str] = ...,
|
||||||
img_url: Optional[str] = None) -> "MessageSegment":
|
img_url: Optional[str] = ...) -> "MessageSegment":
|
||||||
...
|
...
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -1018,9 +1016,9 @@ class MessageSegment:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def video(file: str,
|
def video(file: str,
|
||||||
cache: Optional[bool] = None,
|
cache: Optional[bool] = ...,
|
||||||
proxy: Optional[bool] = None,
|
proxy: Optional[bool] = ...,
|
||||||
timeout: Optional[int] = None) -> "MessageSegment":
|
timeout: Optional[int] = ...) -> "MessageSegment":
|
||||||
...
|
...
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -140,7 +140,7 @@ def on_endswith(msg: str,
|
|||||||
|
|
||||||
def on_command(cmd: Union[str, Tuple[str, ...]],
|
def on_command(cmd: Union[str, Tuple[str, ...]],
|
||||||
rule: Optional[Union[Rule, RuleChecker]] = None,
|
rule: Optional[Union[Rule, RuleChecker]] = None,
|
||||||
aliases: Set[Union[str, Tuple[str, ...]]] = None,
|
aliases: Optional[Set[Union[str, Tuple[str, ...]]]] = None,
|
||||||
**kwargs) -> Union[Type[Matcher], MatcherGroup]:
|
**kwargs) -> Union[Type[Matcher], MatcherGroup]:
|
||||||
if isinstance(cmd, str):
|
if isinstance(cmd, str):
|
||||||
cmd = (cmd,)
|
cmd = (cmd,)
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
from typing import overload
|
||||||
|
|
||||||
from nonebot.typing import Rule, Matcher, Handler, Permission, RuleChecker, MatcherGroup
|
from nonebot.typing import Rule, Matcher, Handler, Permission, RuleChecker, MatcherGroup
|
||||||
from nonebot.typing import Set, List, Dict, Type, Tuple, Union, Optional, ModuleType
|
from nonebot.typing import Set, List, Dict, Type, Tuple, Union, Optional, ModuleType
|
||||||
@ -17,106 +18,120 @@ class Plugin(object):
|
|||||||
matcher: Set[Type[Matcher]]
|
matcher: Set[Type[Matcher]]
|
||||||
|
|
||||||
|
|
||||||
def on(rule: Optional[Union[Rule, RuleChecker]] = None,
|
def on(rule: Optional[Union[Rule, RuleChecker]] = ...,
|
||||||
permission: Optional[Permission] = None,
|
permission: Optional[Permission] = ...,
|
||||||
*,
|
*,
|
||||||
handlers: Optional[List[Handler]] = None,
|
handlers: Optional[List[Handler]] = ...,
|
||||||
temp: bool = False,
|
temp: bool = ...,
|
||||||
priority: int = 1,
|
priority: int = ...,
|
||||||
block: bool = False,
|
block: bool = ...,
|
||||||
state: Optional[dict] = None) -> Type[Matcher]:
|
state: Optional[dict] = ...) -> Type[Matcher]:
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
def on_metaevent(rule: Optional[Union[Rule, RuleChecker]] = None,
|
def on_metaevent(rule: Optional[Union[Rule, RuleChecker]] = ...,
|
||||||
*,
|
*,
|
||||||
handlers: Optional[List[Handler]] = None,
|
handlers: Optional[List[Handler]] = ...,
|
||||||
temp: bool = False,
|
temp: bool = ...,
|
||||||
priority: int = 1,
|
priority: int = ...,
|
||||||
block: bool = False,
|
block: bool = ...,
|
||||||
state: Optional[dict] = None) -> Type[Matcher]:
|
state: Optional[dict] = ...) -> Type[Matcher]:
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
def on_message(rule: Optional[Union[Rule, RuleChecker]] = None,
|
def on_message(rule: Optional[Union[Rule, RuleChecker]] = ...,
|
||||||
permission: Optional[Permission] = None,
|
permission: Optional[Permission] = ...,
|
||||||
*,
|
*,
|
||||||
handlers: Optional[List[Handler]] = None,
|
handlers: Optional[List[Handler]] = ...,
|
||||||
temp: bool = False,
|
temp: bool = ...,
|
||||||
priority: int = 1,
|
priority: int = ...,
|
||||||
block: bool = True,
|
block: bool = ...,
|
||||||
state: Optional[dict] = None) -> Type[Matcher]:
|
state: Optional[dict] = ...) -> Type[Matcher]:
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
def on_notice(rule: Optional[Union[Rule, RuleChecker]] = None,
|
def on_notice(rule: Optional[Union[Rule, RuleChecker]] = ...,
|
||||||
*,
|
*,
|
||||||
handlers: Optional[List[Handler]] = None,
|
handlers: Optional[List[Handler]] = ...,
|
||||||
temp: bool = False,
|
temp: bool = ...,
|
||||||
priority: int = 1,
|
priority: int = ...,
|
||||||
block: bool = False,
|
block: bool = ...,
|
||||||
state: Optional[dict] = None) -> Type[Matcher]:
|
state: Optional[dict] = ...) -> Type[Matcher]:
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
def on_request(rule: Optional[Union[Rule, RuleChecker]] = None,
|
def on_request(rule: Optional[Union[Rule, RuleChecker]] = ...,
|
||||||
*,
|
*,
|
||||||
handlers: Optional[List[Handler]] = None,
|
handlers: Optional[List[Handler]] = ...,
|
||||||
temp: bool = False,
|
temp: bool = ...,
|
||||||
priority: int = 1,
|
priority: int = ...,
|
||||||
block: bool = False,
|
block: bool = ...,
|
||||||
state: Optional[dict] = None) -> Type[Matcher]:
|
state: Optional[dict] = ...) -> Type[Matcher]:
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
def on_startswith(msg: str,
|
def on_startswith(msg: str,
|
||||||
rule: Optional[Optional[Union[Rule, RuleChecker]]] = None,
|
rule: Optional[Optional[Union[Rule, RuleChecker]]] = ...,
|
||||||
permission: Optional[Permission] = None,
|
permission: Optional[Permission] = ...,
|
||||||
*,
|
*,
|
||||||
handlers: Optional[List[Handler]] = None,
|
handlers: Optional[List[Handler]] = ...,
|
||||||
temp: bool = False,
|
temp: bool = ...,
|
||||||
priority: int = 1,
|
priority: int = ...,
|
||||||
block: bool = True,
|
block: bool = ...,
|
||||||
state: Optional[dict] = None) -> Type[Matcher]:
|
state: Optional[dict] = ...) -> Type[Matcher]:
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
def on_endswith(msg: str,
|
def on_endswith(msg: str,
|
||||||
rule: Optional[Optional[Union[Rule, RuleChecker]]] = None,
|
rule: Optional[Optional[Union[Rule, RuleChecker]]] = ...,
|
||||||
permission: Optional[Permission] = None,
|
permission: Optional[Permission] = ...,
|
||||||
*,
|
*,
|
||||||
handlers: Optional[List[Handler]] = None,
|
handlers: Optional[List[Handler]] = ...,
|
||||||
temp: bool = False,
|
temp: bool = ...,
|
||||||
priority: int = 1,
|
priority: int = ...,
|
||||||
block: bool = True,
|
block: bool = ...,
|
||||||
state: Optional[dict] = None) -> Type[Matcher]:
|
state: Optional[dict] = ...) -> Type[Matcher]:
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
def on_command(
|
@overload
|
||||||
cmd: Union[str, Tuple[str, ...]],
|
def on_command(cmd: Union[str, Tuple[str, ...]],
|
||||||
rule: Optional[Union[Rule, RuleChecker]] = None,
|
rule: Optional[Union[Rule, RuleChecker]] = ...,
|
||||||
aliases: Set[Union[str, Tuple[str, ...]]] = None,
|
aliases: None = ...,
|
||||||
permission: Optional[Permission] = None,
|
permission: Optional[Permission] = ...,
|
||||||
*,
|
*,
|
||||||
handlers: Optional[List[Handler]] = None,
|
handlers: Optional[List[Handler]] = ...,
|
||||||
temp: bool = False,
|
temp: bool = ...,
|
||||||
priority: int = 1,
|
priority: int = ...,
|
||||||
block: bool = True,
|
block: bool = ...,
|
||||||
state: Optional[dict] = None) -> Union[Type[Matcher], MatcherGroup]:
|
state: Optional[dict] = ...) -> Type[Matcher]:
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
@overload
|
||||||
|
def on_command(cmd: Union[str, Tuple[str, ...]],
|
||||||
|
rule: Optional[Union[Rule, RuleChecker]] = ...,
|
||||||
|
aliases: Set[Union[str, Tuple[str, ...]]] = ...,
|
||||||
|
permission: Optional[Permission] = ...,
|
||||||
|
*,
|
||||||
|
handlers: Optional[List[Handler]] = ...,
|
||||||
|
temp: bool = ...,
|
||||||
|
priority: int = ...,
|
||||||
|
block: bool = ...,
|
||||||
|
state: Optional[dict] = ...) -> MatcherGroup:
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
def on_regex(pattern: str,
|
def on_regex(pattern: str,
|
||||||
flags: Union[int, re.RegexFlag] = 0,
|
flags: Union[int, re.RegexFlag] = 0,
|
||||||
rule: Optional[Rule] = None,
|
rule: Optional[Rule] = ...,
|
||||||
permission: Optional[Permission] = None,
|
permission: Optional[Permission] = ...,
|
||||||
*,
|
*,
|
||||||
handlers: Optional[List[Handler]] = None,
|
handlers: Optional[List[Handler]] = ...,
|
||||||
temp: bool = False,
|
temp: bool = ...,
|
||||||
priority: int = 1,
|
priority: int = ...,
|
||||||
block: bool = True,
|
block: bool = ...,
|
||||||
state: Optional[dict] = None) -> Type[Matcher]:
|
state: Optional[dict] = ...) -> Type[Matcher]:
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
@ -140,26 +155,26 @@ class CommandGroup:
|
|||||||
|
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
cmd: Union[str, Tuple[str, ...]],
|
cmd: Union[str, Tuple[str, ...]],
|
||||||
rule: Optional[Union[Rule, RuleChecker]] = None,
|
rule: Optional[Union[Rule, RuleChecker]] = ...,
|
||||||
permission: Optional[Permission] = None,
|
permission: Optional[Permission] = ...,
|
||||||
*,
|
*,
|
||||||
handlers: Optional[List[Handler]] = None,
|
handlers: Optional[List[Handler]] = ...,
|
||||||
temp: bool = False,
|
temp: bool = ...,
|
||||||
priority: int = 1,
|
priority: int = ...,
|
||||||
block: bool = True,
|
block: bool = ...,
|
||||||
state: Optional[dict] = None):
|
state: Optional[dict] = ...):
|
||||||
...
|
...
|
||||||
|
|
||||||
def command(
|
def command(
|
||||||
self,
|
self,
|
||||||
cmd: Union[str, Tuple[str, ...]],
|
cmd: Union[str, Tuple[str, ...]],
|
||||||
rule: Optional[Union[Rule, RuleChecker]] = None,
|
rule: Optional[Union[Rule, RuleChecker]] = ...,
|
||||||
aliases: Set[Union[str, Tuple[str, ...]]] = None,
|
aliases: Set[Union[str, Tuple[str, ...]]] = ...,
|
||||||
permission: Optional[Permission] = None,
|
permission: Optional[Permission] = ...,
|
||||||
*,
|
*,
|
||||||
handlers: Optional[List[Handler]] = None,
|
handlers: Optional[List[Handler]] = ...,
|
||||||
temp: bool = False,
|
temp: bool = ...,
|
||||||
priority: int = 1,
|
priority: int = ...,
|
||||||
block: bool = True,
|
block: bool = ...,
|
||||||
state: Optional[dict] = None) -> Union[Type[Matcher], MatcherGroup]:
|
state: Optional[dict] = ...) -> Union[Type[Matcher], MatcherGroup]:
|
||||||
...
|
...
|
||||||
|
Reference in New Issue
Block a user