Skip to content

Commit 6fcb41c

Browse files
committed
Updates for 1.4.0
1 parent c0d1058 commit 6fcb41c

File tree

8 files changed

+19
-14
lines changed

8 files changed

+19
-14
lines changed

discord-stubs/enums.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,15 @@ class UserFlags(Enum):
182182
partner: int
183183
hypesquad: int
184184
bug_hunter: int
185+
mfa_sms: int
186+
premium_promo_dismissed: int
185187
hypesquad_bravery: int
186188
hypesquad_brilliance: int
187189
hypesquad_balance: int
188190
early_supporter: int
189191
team_user: int
190192
system: int
193+
has_unread_urgent_messages: int
191194
bug_hunter_level_2: int
192195
verified_bot: int
193196
verified_bot_developer: int

discord-stubs/errors.pyi

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ class InvalidArgument(ClientException): ...
2424
class LoginFailure(ClientException): ...
2525

2626
class ConnectionClosed(ClientException):
27-
code: int
27+
code: Optional[int]
2828
reason: str
2929
shard_id: Optional[int]
3030
def __init__(
31-
self, socket: aiohttp.ClientWebSocketResponse, *, shard_id: Optional[int]
31+
self,
32+
socket: aiohttp.ClientWebSocketResponse,
33+
*,
34+
shard_id: Optional[int],
35+
code: Optional[int] = ...,
3236
) -> None: ...

discord-stubs/ext/commands/cooldowns.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class Cooldown:
2525
type: BucketType
2626
def __init__(self, rate: int, per: float, type: BucketType) -> None: ...
2727
def get_tokens(self, current: Optional[int] = ...) -> int: ...
28+
def get_retry_after(self, current: Optional[float] = ...) -> float: ...
2829
def update_rate_limit(self, current: Optional[float] = ...) -> Optional[float]: ...
2930
def reset(self) -> None: ...
3031
def copy(self) -> Cooldown: ...

discord-stubs/ext/commands/core.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ class Command(_BaseCommand, Generic[_CT]):
117117
async def prepare(self, ctx: _CT) -> None: ...
118118
def is_on_cooldown(self, ctx: _CT) -> bool: ...
119119
def reset_cooldown(self, ctx: _CT) -> None: ...
120+
def get_cooldown_retry_after(self, ctx: _CT) -> float: ...
120121
async def invoke(self, ctx: _CT) -> None: ...
121122
async def reinvoke(self, ctx: _CT, *, call_hooks: bool = ...) -> None: ...
122123
def error(self, coro: _C) -> _C: ...

discord-stubs/ext/commands/help.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import discord
2424
from .cog import Cog
2525
from .context import Context
2626
from .cooldowns import Cooldown
27-
from .core import Command, Group
27+
from .core import Command, Group, _CheckPredicate
2828
from .errors import CommandError
2929

3030
_T = TypeVar('_T')
@@ -45,6 +45,7 @@ class _CommandAttrs(TypedDict, total=False):
4545
ignore_extra: bool
4646
cooldown: Cooldown
4747
parent: Command[Context]
48+
checks: List[_CheckPredicate[Any]]
4849

4950
class _PaginatorProtocol(Protocol):
5051
prefix: Optional[str]
@@ -96,6 +97,8 @@ class HelpCommand(Generic[_CT]):
9697
command_attrs: _CommandAttrs = ...,
9798
) -> None: ...
9899
def copy(self: _HC) -> _HC: ...
100+
def add_check(self, func: _CheckPredicate[_CT]) -> None: ...
101+
def remove_check(self, func: _CheckPredicate[_CT]) -> None: ...
99102
def get_bot_mapping(self) -> Dict[Optional[Cog[_CT]], List[Command[_CT]]]: ...
100103
@property
101104
def clean_prefix(self) -> str: ...

poetry.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ typing-extensions = "^3.7.4"
2222

2323
[tool.poetry.dev-dependencies]
2424
black = "^19.10b0"
25-
"discord.py" = {git = "https://github.com/Rapptz/discord.py.git", rev = "ae1ec8072f9ef26acec107824eed42fdbb897cc2"}
25+
"discord.py" = {git = "https://github.com/Rapptz/discord.py.git", rev = "9048914756b2e0542af015c48ae52bb468ef8ea9"}
2626
flake8 = "^3.8.3"
2727
flake8-pyi = "^20.5.0"
2828
isort = "^5.3.0"

stubtest-whitelist.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,7 @@ discord.state.ConnectionState.store_user
222222
discord.state.ConnectionState.voice_clients
223223
discord.team.Team.__init__
224224
discord.team.TeamMember.__init__
225-
discord.template.T
226225
discord.template.Template.__init__
227-
discord.template.a
228-
discord.template.e
229-
discord.template.l
230-
discord.template.m
231-
discord.template.p
232-
discord.template.t
233226
discord.user.BaseUser.__init__
234227
discord.user.ClientUser.__init__
235228
discord.user.Profile.__doc__

0 commit comments

Comments
 (0)