🏷️ update pyi files

This commit is contained in:
yanyongyu 2020-09-28 12:45:55 +08:00
parent 35ed536cdf
commit 00f22e5f05
3 changed files with 191 additions and 178 deletions

View File

@ -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,
message: Union[str, Message],
auto_escape: bool = False,
self_id: Optional[int] = None) -> Dict[str, Any]:
auto_escape: bool = ...,
self_id: Optional[int] = ...) -> Dict[str, Any]:
"""
:说明:
@ -148,8 +148,8 @@ class Bot(BaseBot):
*,
group_id: int,
message: Union[str, Message],
auto_escape: bool = False,
self_id: Optional[int] = None) -> Dict[str, Any]:
auto_escape: bool = ...,
self_id: Optional[int] = ...) -> Dict[str, Any]:
"""
:说明:
@ -166,12 +166,12 @@ class Bot(BaseBot):
async def send_msg(self,
*,
message_type: Optional[str] = None,
user_id: Optional[int] = None,
group_id: Optional[int] = None,
message_type: Optional[str] = ...,
user_id: Optional[int] = ...,
group_id: Optional[int] = ...,
message: Union[str, Message],
auto_escape: bool = False,
self_id: Optional[int] = None) -> Dict[str, Any]:
auto_escape: bool = ...,
self_id: Optional[int] = ...) -> Dict[str, Any]:
"""
:说明:
@ -191,7 +191,7 @@ class Bot(BaseBot):
async def delete_msg(self,
*,
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,
*,
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,
*,
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,
*,
user_id: int,
times: int = 1,
self_id: Optional[int] = None) -> None:
times: int = ...,
self_id: Optional[int] = ...) -> None:
"""
:说明:
@ -258,8 +258,8 @@ class Bot(BaseBot):
*,
group_id: int,
user_id: int,
reject_add_request: bool = False,
self_id: Optional[int] = None) -> None:
reject_add_request: bool = ...,
self_id: Optional[int] = ...) -> None:
"""
:说明:
@ -278,8 +278,8 @@ class Bot(BaseBot):
*,
group_id: int,
user_id: int,
duration: int = 30 * 60,
self_id: Optional[int] = None) -> None:
duration: int = ...,
self_id: Optional[int] = ...) -> None:
"""
:说明:
@ -297,11 +297,10 @@ class Bot(BaseBot):
async def set_group_anonymous_ban(self,
*,
group_id: int,
anonymous: Optional[Dict[str,
Any]] = None,
anonymous_flag: Optional[str] = None,
duration: int = 30 * 60,
self_id: Optional[int] = None) -> None:
anonymous: Optional[Dict[str, Any]] = ...,
anonymous_flag: Optional[str] = ...,
duration: int = ...,
self_id: Optional[int] = ...) -> None:
"""
:说明:
@ -320,8 +319,8 @@ class Bot(BaseBot):
async def set_group_whole_ban(self,
*,
group_id: int,
enable: bool = True,
self_id: Optional[int] = None) -> None:
enable: bool = ...,
self_id: Optional[int] = ...) -> None:
"""
:说明:
@ -339,8 +338,8 @@ class Bot(BaseBot):
*,
group_id: int,
user_id: int,
enable: bool = True,
self_id: Optional[int] = None) -> None:
enable: bool = ...,
self_id: Optional[int] = ...) -> None:
"""
:说明:
@ -358,8 +357,8 @@ class Bot(BaseBot):
async def set_group_anonymous(self,
*,
group_id: int,
enable: bool = True,
self_id: Optional[int] = None) -> None:
enable: bool = ...,
self_id: Optional[int] = ...) -> None:
"""
:说明:
@ -377,8 +376,8 @@ class Bot(BaseBot):
*,
group_id: int,
user_id: int,
card: str = "",
self_id: Optional[int] = None) -> None:
card: str = ...,
self_id: Optional[int] = ...) -> None:
"""
:说明:
@ -397,7 +396,7 @@ class Bot(BaseBot):
*,
group_id: int,
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,
*,
group_id: int,
is_dismiss: bool = False,
self_id: Optional[int] = None) -> None:
is_dismiss: bool = ...,
self_id: Optional[int] = ...) -> None:
"""
:说明:
@ -433,9 +432,9 @@ class Bot(BaseBot):
*,
group_id: int,
user_id: int,
special_title: str = "",
duration: int = -1,
self_id: Optional[int] = None) -> None:
special_title: str = ...,
duration: int = ...,
self_id: Optional[int] = ...) -> None:
"""
:说明:
@ -454,9 +453,9 @@ class Bot(BaseBot):
async def set_friend_add_request(self,
*,
flag: str,
approve: bool = True,
remark: str = "",
self_id: Optional[int] = None) -> None:
approve: bool = ...,
remark: str = ...,
self_id: Optional[int] = ...) -> None:
"""
:说明:
@ -475,9 +474,9 @@ class Bot(BaseBot):
*,
flag: str,
sub_type: str,
approve: bool = True,
reason: str = "",
self_id: Optional[int] = None) -> None:
approve: bool = ...,
reason: str = ...,
self_id: Optional[int] = ...) -> None:
"""
:说明:
@ -495,7 +494,7 @@ class Bot(BaseBot):
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(
self,
*,
user_id: int,
no_cache: bool = False,
self_id: Optional[int] = None) -> Dict[str, Any]:
async def get_stranger_info(self,
*,
user_id: int,
no_cache: bool = ...,
self_id: Optional[int] = ...) -> Dict[str, Any]:
"""
:说明:
@ -528,7 +526,7 @@ class Bot(BaseBot):
async def get_friend_list(self,
*,
self_id: Optional[int] = None
self_id: Optional[int] = ...
) -> List[Dict[str, Any]]:
"""
:说明:
@ -544,8 +542,8 @@ class Bot(BaseBot):
async def get_group_info(self,
*,
group_id: int,
no_cache: bool = False,
self_id: Optional[int] = None) -> Dict[str, Any]:
no_cache: bool = ...,
self_id: Optional[int] = ...) -> Dict[str, Any]:
"""
:说明:
@ -561,7 +559,7 @@ class Bot(BaseBot):
async def get_group_list(self,
*,
self_id: Optional[int] = None
self_id: Optional[int] = ...
) -> List[Dict[str, Any]]:
"""
:说明:
@ -579,8 +577,8 @@ class Bot(BaseBot):
*,
group_id: int,
user_id: int,
no_cache: bool = False,
self_id: Optional[int] = None) -> Dict[str, Any]:
no_cache: bool = ...,
self_id: Optional[int] = ...) -> Dict[str, Any]:
"""
:说明:
@ -599,7 +597,7 @@ class Bot(BaseBot):
self,
*,
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(
self,
*,
group_id: int,
type: str = "all",
self_id: Optional[int] = None) -> Dict[str, Any]:
async def get_group_honor_info(self,
*,
group_id: int,
type: str = ...,
self_id: Optional[int] = ...
) -> Dict[str, Any]:
"""
:说明:
@ -633,8 +631,8 @@ class Bot(BaseBot):
async def get_cookies(self,
*,
domain: str = "",
self_id: Optional[int] = None) -> Dict[str, Any]:
domain: str = ...,
self_id: Optional[int] = ...) -> Dict[str, Any]:
"""
:说明:
@ -649,7 +647,7 @@ class Bot(BaseBot):
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,
*,
domain: str = "",
self_id: Optional[int] = None) -> Dict[str, Any]:
domain: str = ...,
self_id: Optional[int] = ...) -> Dict[str, Any]:
"""
:说明:
@ -681,7 +679,7 @@ class Bot(BaseBot):
*,
file: 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,
*,
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,
*,
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,
*,
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,
*,
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,
*,
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,
*,
delay: int = 0,
self_id: Optional[int] = None) -> None:
delay: int = ...,
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
def anonymous(ignore_failure: Optional[bool] = None) -> "MessageSegment":
def anonymous(ignore_failure: Optional[bool] = ...) -> "MessageSegment":
...
@staticmethod
@ -943,10 +941,10 @@ class MessageSegment:
@staticmethod
def image(file: str,
type_: Optional[str] = None,
cache: bool = True,
proxy: bool = True,
timeout: Optional[int] = None) -> "MessageSegment":
type_: Optional[str] = ...,
cache: bool = ...,
proxy: bool = ...,
timeout: Optional[int] = ...) -> "MessageSegment":
...
@staticmethod
@ -956,8 +954,8 @@ class MessageSegment:
@staticmethod
def location(latitude: float,
longitude: float,
title: Optional[str] = None,
content: Optional[str] = None) -> "MessageSegment":
title: Optional[str] = ...,
content: Optional[str] = ...) -> "MessageSegment":
...
@staticmethod
@ -968,8 +966,8 @@ class MessageSegment:
def music_custom(url: str,
audio: str,
title: str,
content: Optional[str] = None,
img_url: Optional[str] = None) -> "MessageSegment":
content: Optional[str] = ...,
img_url: Optional[str] = ...) -> "MessageSegment":
...
@staticmethod
@ -987,10 +985,10 @@ class MessageSegment:
@staticmethod
def record(file: str,
magic: Optional[bool] = None,
cache: Optional[bool] = None,
proxy: Optional[bool] = None,
timeout: Optional[int] = None) -> "MessageSegment":
magic: Optional[bool] = ...,
cache: Optional[bool] = ...,
proxy: Optional[bool] = ...,
timeout: Optional[int] = ...) -> "MessageSegment":
...
@staticmethod
@ -1006,10 +1004,10 @@ class MessageSegment:
...
@staticmethod
def share(url: str = "",
title: str = "",
content: Optional[str] = None,
img_url: Optional[str] = None) -> "MessageSegment":
def share(url: str = ...,
title: str = ...,
content: Optional[str] = ...,
img_url: Optional[str] = ...) -> "MessageSegment":
...
@staticmethod
@ -1018,9 +1016,9 @@ class MessageSegment:
@staticmethod
def video(file: str,
cache: Optional[bool] = None,
proxy: Optional[bool] = None,
timeout: Optional[int] = None) -> "MessageSegment":
cache: Optional[bool] = ...,
proxy: Optional[bool] = ...,
timeout: Optional[int] = ...) -> "MessageSegment":
...
@staticmethod

View File

@ -140,7 +140,7 @@ def on_endswith(msg: str,
def on_command(cmd: Union[str, Tuple[str, ...]],
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]:
if isinstance(cmd, str):
cmd = (cmd,)

View File

@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
import re
from typing import overload
from nonebot.typing import Rule, Matcher, Handler, Permission, RuleChecker, MatcherGroup
from nonebot.typing import Set, List, Dict, Type, Tuple, Union, Optional, ModuleType
@ -17,106 +18,120 @@ class Plugin(object):
matcher: Set[Type[Matcher]]
def on(rule: Optional[Union[Rule, RuleChecker]] = None,
permission: Optional[Permission] = None,
def on(rule: Optional[Union[Rule, RuleChecker]] = ...,
permission: Optional[Permission] = ...,
*,
handlers: Optional[List[Handler]] = None,
temp: bool = False,
priority: int = 1,
block: bool = False,
state: Optional[dict] = None) -> Type[Matcher]:
handlers: Optional[List[Handler]] = ...,
temp: bool = ...,
priority: int = ...,
block: bool = ...,
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,
temp: bool = False,
priority: int = 1,
block: bool = False,
state: Optional[dict] = None) -> Type[Matcher]:
handlers: Optional[List[Handler]] = ...,
temp: bool = ...,
priority: int = ...,
block: bool = ...,
state: Optional[dict] = ...) -> Type[Matcher]:
...
def on_message(rule: Optional[Union[Rule, RuleChecker]] = None,
permission: Optional[Permission] = None,
def on_message(rule: Optional[Union[Rule, RuleChecker]] = ...,
permission: Optional[Permission] = ...,
*,
handlers: Optional[List[Handler]] = None,
temp: bool = False,
priority: int = 1,
block: bool = True,
state: Optional[dict] = None) -> Type[Matcher]:
handlers: Optional[List[Handler]] = ...,
temp: bool = ...,
priority: int = ...,
block: bool = ...,
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,
temp: bool = False,
priority: int = 1,
block: bool = False,
state: Optional[dict] = None) -> Type[Matcher]:
handlers: Optional[List[Handler]] = ...,
temp: bool = ...,
priority: int = ...,
block: bool = ...,
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,
temp: bool = False,
priority: int = 1,
block: bool = False,
state: Optional[dict] = None) -> Type[Matcher]:
handlers: Optional[List[Handler]] = ...,
temp: bool = ...,
priority: int = ...,
block: bool = ...,
state: Optional[dict] = ...) -> Type[Matcher]:
...
def on_startswith(msg: str,
rule: Optional[Optional[Union[Rule, RuleChecker]]] = None,
permission: Optional[Permission] = None,
rule: Optional[Optional[Union[Rule, RuleChecker]]] = ...,
permission: Optional[Permission] = ...,
*,
handlers: Optional[List[Handler]] = None,
temp: bool = False,
priority: int = 1,
block: bool = True,
state: Optional[dict] = None) -> Type[Matcher]:
handlers: Optional[List[Handler]] = ...,
temp: bool = ...,
priority: int = ...,
block: bool = ...,
state: Optional[dict] = ...) -> Type[Matcher]:
...
def on_endswith(msg: str,
rule: Optional[Optional[Union[Rule, RuleChecker]]] = None,
permission: Optional[Permission] = None,
rule: Optional[Optional[Union[Rule, RuleChecker]]] = ...,
permission: Optional[Permission] = ...,
*,
handlers: Optional[List[Handler]] = None,
temp: bool = False,
priority: int = 1,
block: bool = True,
state: Optional[dict] = None) -> Type[Matcher]:
handlers: Optional[List[Handler]] = ...,
temp: bool = ...,
priority: int = ...,
block: bool = ...,
state: Optional[dict] = ...) -> Type[Matcher]:
...
def on_command(
cmd: Union[str, Tuple[str, ...]],
rule: Optional[Union[Rule, RuleChecker]] = None,
aliases: Set[Union[str, Tuple[str, ...]]] = None,
permission: Optional[Permission] = None,
*,
handlers: Optional[List[Handler]] = None,
temp: bool = False,
priority: int = 1,
block: bool = True,
state: Optional[dict] = None) -> Union[Type[Matcher], MatcherGroup]:
@overload
def on_command(cmd: Union[str, Tuple[str, ...]],
rule: Optional[Union[Rule, RuleChecker]] = ...,
aliases: None = ...,
permission: Optional[Permission] = ...,
*,
handlers: Optional[List[Handler]] = ...,
temp: bool = ...,
priority: int = ...,
block: bool = ...,
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,
flags: Union[int, re.RegexFlag] = 0,
rule: Optional[Rule] = None,
permission: Optional[Permission] = None,
rule: Optional[Rule] = ...,
permission: Optional[Permission] = ...,
*,
handlers: Optional[List[Handler]] = None,
temp: bool = False,
priority: int = 1,
block: bool = True,
state: Optional[dict] = None) -> Type[Matcher]:
handlers: Optional[List[Handler]] = ...,
temp: bool = ...,
priority: int = ...,
block: bool = ...,
state: Optional[dict] = ...) -> Type[Matcher]:
...
@ -140,26 +155,26 @@ class CommandGroup:
def __init__(self,
cmd: Union[str, Tuple[str, ...]],
rule: Optional[Union[Rule, RuleChecker]] = None,
permission: Optional[Permission] = None,
rule: Optional[Union[Rule, RuleChecker]] = ...,
permission: Optional[Permission] = ...,
*,
handlers: Optional[List[Handler]] = None,
temp: bool = False,
priority: int = 1,
block: bool = True,
state: Optional[dict] = None):
handlers: Optional[List[Handler]] = ...,
temp: bool = ...,
priority: int = ...,
block: bool = ...,
state: Optional[dict] = ...):
...
def command(
self,
cmd: Union[str, Tuple[str, ...]],
rule: Optional[Union[Rule, RuleChecker]] = None,
aliases: Set[Union[str, Tuple[str, ...]]] = None,
permission: Optional[Permission] = None,
rule: Optional[Union[Rule, RuleChecker]] = ...,
aliases: Set[Union[str, Tuple[str, ...]]] = ...,
permission: Optional[Permission] = ...,
*,
handlers: Optional[List[Handler]] = None,
temp: bool = False,
priority: int = 1,
block: bool = True,
state: Optional[dict] = None) -> Union[Type[Matcher], MatcherGroup]:
handlers: Optional[List[Handler]] = ...,
temp: bool = ...,
priority: int = ...,
block: bool = ...,
state: Optional[dict] = ...) -> Union[Type[Matcher], MatcherGroup]:
...