Skip to content

Commit eef5b46

Browse files
authored
Merge branch 'master' into master
Signed-off-by: tyrantlink <[email protected]>
2 parents 8d0a6d0 + 05cf45e commit eef5b46

File tree

7 files changed

+33
-7
lines changed

7 files changed

+33
-7
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ repos:
2121
# - --remove-duplicate-keys
2222
# - --remove-unused-variables
2323
- repo: https://github.com/asottile/pyupgrade
24-
rev: v3.18.0
24+
rev: v3.19.0
2525
hooks:
2626
- id: pyupgrade
2727
exclude: \.(po|pot|yml|yaml)$

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ These changes are available on the `master` branch, but have not yet been releas
4848
([#2595](https://github.com/Pycord-Development/pycord/pull/2595))
4949
- Fixed `BucketType.category` cooldown commands not functioning correctly in private
5050
channels. ([#2603](https://github.com/Pycord-Development/pycord/pull/2603))
51+
- Fixed `SlashCommand`'s `ctx` parameter couldn't be `Union` type.
52+
([#2611](https://github.com/Pycord-Development/pycord/pull/2611))
53+
- Fixed `TypeError` when passing `skus` parameter in `Client.entitlements()`.
54+
([#2627](https://github.com/Pycord-Development/pycord/issues/2627))
5155
- Fixed `Webhook._WebhookState` missing `store_poll` method.
5256
([#2624](https://github.com/Pycord-Development/pycord/pull/2624))
5357

discord/commands/options.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
Thread,
4040
VoiceChannel,
4141
)
42+
from ..commands import ApplicationContext
4243
from ..enums import ChannelType
4344
from ..enums import Enum as DiscordEnum
4445
from ..enums import SlashCommandOptionType
@@ -227,6 +228,13 @@ def __init__(
227228
else:
228229
from ..ext.commands import Converter
229230

231+
if isinstance(input_type, tuple) and any(
232+
issubclass(op, ApplicationContext) for op in input_type
233+
):
234+
input_type = next(
235+
op for op in input_type if issubclass(op, ApplicationContext)
236+
)
237+
230238
if (
231239
isinstance(input_type, Converter)
232240
or input_type_is_class

discord/gateway.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,16 @@ def latency(self) -> float:
587587

588588
def _can_handle_close(self):
589589
code = self._close_code or self.socket.close_code
590-
return code not in (1000, 4004, 4010, 4011, 4012, 4013, 4014)
590+
is_improper_close = self._close_code is None and self.socket.close_code == 1000
591+
return is_improper_close or code not in (
592+
1000,
593+
4004,
594+
4010,
595+
4011,
596+
4012,
597+
4013,
598+
4014,
599+
)
591600

592601
async def poll_event(self):
593602
"""Polls for a DISPATCH event and handles the general gateway loop.

discord/http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3012,7 +3012,7 @@ def list_entitlements(
30123012
if user_id is not None:
30133013
params["user_id"] = user_id
30143014
if sku_ids is not None:
3015-
params["sku_ids"] = ",".join(sku_ids)
3015+
params["sku_ids"] = ",".join(str(sku_id) for sku_id in sku_ids)
30163016
if before is not None:
30173017
params["before"] = before
30183018
if after is not None:

docs/ext/bridge/api.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,16 @@ BridgeContext Subclasses
158158

159159
Alias of :data:`typing.Union` [ :class:`.BridgeExtContext`, :class:`.BridgeApplicationContext` ] for typing convenience.
160160

161-
Option
161+
Options
162162
------
163163

164-
BridgeOption
165-
~~~~~~~~~~~~
164+
Shortcut Decorators
165+
~~~~~~~~~~~~~~~~~~~
166+
.. autofunction:: discord.ext.bridge.bridge_option
167+
:decorator:
168+
169+
Objects
170+
~~~~~~~
166171

167172
.. attributetable:: discord.ext.bridge.BridgeOption
168173

requirements/docs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ furo==2024.8.6
88
sphinx-autodoc-typehints==2.2.3
99
sphinx-intl==2.2.0
1010
typing_extensions==4.12.2
11-
levenshtein==0.26.0
11+
levenshtein==0.26.1

0 commit comments

Comments
 (0)