Skip to content

Commit 2078cef

Browse files
Paillat-devLumabotsNeloBlivionpre-commit-ci[bot]Hema2-official
authored
chore: merge upstream repo (#37)
* fix: Role Edit TypeHint (Pycord-Development#2795) Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> * fix: command syncing edge cases (Pycord-Development#2797) * change default nsfw to false * cl * localizations * := * style(pre-commit): auto fixes from pre-commit.com hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix: VoiceClient crashes while receiving audio (Pycord-Development#2800) Signed-off-by: Hema2 <49586027+Hema2-official@users.noreply.github.com> Co-authored-by: Lala Sabathil <lala@pycord.dev> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * chore(deps): bump typing-extensions from 4.13.1 to 4.13.2 in the patch-version-bumps group (Pycord-Development#2783) chore(deps): bump typing-extensions in the patch-version-bumps group Bumps the patch-version-bumps group with 1 update: [typing-extensions](https://github.com/python/typing_extensions). Updates `typing-extensions` from 4.13.1 to 4.13.2 - [Release notes](https://github.com/python/typing_extensions/releases) - [Changelog](https://github.com/python/typing_extensions/blob/main/CHANGELOG.md) - [Commits](python/typing_extensions@4.13.1...4.13.2) --- updated-dependencies: - dependency-name: typing-extensions dependency-version: 4.13.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch-version-bumps ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: add created_at property to Interaction (Pycord-Development#2801) * feat: add created_at property to Interaction for message creation time * Update CHANGELOG.md * Update discord/interactions.py Co-authored-by: UK <41271523+NeloBlivion@users.noreply.github.com> Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> * Update CHANGELOG.md Co-authored-by: DA344 <108473820+DA-344@users.noreply.github.com> Signed-off-by: Lala Sabathil <aiko@aitsys.dev> --------- Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> Signed-off-by: Lala Sabathil <aiko@aitsys.dev> Co-authored-by: UK <41271523+NeloBlivion@users.noreply.github.com> Co-authored-by: Lala Sabathil <aiko@aitsys.dev> Co-authored-by: DA344 <108473820+DA-344@users.noreply.github.com> * chore(deps): update setuptools requirement from <=78.1.0,>=62.6 to >=62.6,<=80.8.0 (Pycord-Development#2786) chore(deps): update setuptools requirement Updates the requirements on [setuptools](https://github.com/pypa/setuptools) to permit the latest version. - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst) - [Commits](pypa/setuptools@v72.2.0...v80.8.0) --- updated-dependencies: - dependency-name: setuptools dependency-version: 80.8.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore!: 🔥 Remove deprecated support for Option in bridge commands (Pycord-Development#2731) * 🔥 Remove deprecated support for Option in bridge commands * 📝 CHANGELOG.md * ♻️ Better logic --------- Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> * fix: 🐛 `TypeError` when specifying `thread_name` in Webhook.send (Pycord-Development#2761) * 🐛 Handle `thread_name` in `handle_message_parameters` to allow sending to thread with multipart * 📝 CHANGELOG.md * Update CHANGELOG.md Co-authored-by: plun1331 <plun1331@gmail.com> Signed-off-by: Paillat <jeremiecotti@ik.me> --------- Signed-off-by: Paillat <me@paillat.dev> Signed-off-by: Paillat <jeremiecotti@ik.me> Co-authored-by: plun1331 <plun1331@gmail.com> Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> * fix: add BanEntry to __all__ exports in guild.py (Pycord-Development#2798) * fix: add BanEntry to __all__ exports in guild.py * Hold on Signed-off-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> --------- Signed-off-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> * fix: correct generic return type in component utils (Pycord-Development#2796) * Update CHANGELOG.md Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> * sync with pycord * fix: update Item type hints to Item[View] in view.py * fix: update Item type hints to use TypeVar[V] in view.py --------- Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> * chore(deps): update setuptools-scm requirement from <=8.2.1,>=6.2 to >=6.2,<=8.3.1 (Pycord-Development#2785) chore(deps): update setuptools-scm requirement Updates the requirements on [setuptools-scm](https://github.com/pypa/setuptools-scm) to permit the latest version. - [Release notes](https://github.com/pypa/setuptools-scm/releases) - [Changelog](https://github.com/pypa/setuptools-scm/blob/main/CHANGELOG.md) - [Commits](pypa/setuptools-scm@v8.1.0...v8.3.1) --- updated-dependencies: - dependency-name: setuptools-scm dependency-version: 8.3.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): update pylint requirement from ~=3.3.6 to ~=3.3.7 (Pycord-Development#2784) Updates the requirements on [pylint](https://github.com/pylint-dev/pylint) to permit the latest version. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](pylint-dev/pylint@v3.3.6...v3.3.7) --- updated-dependencies: - dependency-name: pylint dependency-version: 3.3.7 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(pre-commit): pre-commit autoupdate (Pycord-Development#2792) updates: - [github.com/asottile/pyupgrade: v3.19.1 → v3.20.0](asottile/pyupgrade@v3.19.1...v3.20.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * docs: 📝 Fix malformed CHANGELOG.md hyperlinks (Pycord-Development#2804) :memo: Fix CHANGELOG.md formatting * fix: :bug: Fix `ValueError` when using `Flag` (Pycord-Development#2759) * 🐛 Fix `dataclasses.field` can't be reused * 📝 CHANGELOG.md * Update CHANGELOG.md Signed-off-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> * ♻️ Move `_missing_field_factory` to flags.py and remove incorrect comment --------- Signed-off-by: Paillat <me@paillat.dev> Signed-off-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> * ci(deps): bump crowdin/github-action from 2.7.0 to 2.7.1 in the patch-version-bumps group (Pycord-Development#2805) ci(deps): bump crowdin/github-action in the patch-version-bumps group Bumps the patch-version-bumps group with 1 update: [crowdin/github-action](https://github.com/crowdin/github-action). Updates `crowdin/github-action` from 2.7.0 to 2.7.1 - [Release notes](https://github.com/crowdin/github-action/releases) - [Commits](crowdin/github-action@v2.7.0...v2.7.1) --- updated-dependencies: - dependency-name: crowdin/github-action dependency-version: 2.7.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch-version-bumps ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: resolve regex library warnings (Pycord-Development#2807) Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com> * fix: support emoji aliases like `:smile:` in PartialEmoji.from_str (Pycord-Development#2774) * handle emoji_lib Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> * style(pre-commit): auto fixes from pre-commit.com hooks * Update CHANGELOG.md Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> * usage of dismoji Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> * Update _.txt Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> * removal of dismoji Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> * Update _.txt Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> * style(pre-commit): auto fixes from pre-commit.com hooks * NEED HELP Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> * style(pre-commit): auto fixes from pre-commit.com hooks * Update partial_emoji.py Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> * style(pre-commit): auto fixes from pre-commit.com hooks * Add files via upload Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> * style(pre-commit): auto fixes from pre-commit.com hooks * Update partial_emoji.py Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> * Update discord/partial_emoji.py Co-authored-by: plun1331 <plun1331@gmail.com> Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> * feature(partial_emoji): support :name: and name * fix(partial_emoji): remove unnecessary data variable after processing emojis * Update partial_emoji.py Co-authored-by: Paillat <jeremiecotti@ik.me> Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> * reduce emoji.json weight * Update emojis.json Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> * refactor: replace Path with importlib.resources for loading emojis.json * Update emojis.json Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> --------- Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: plun1331 <plun1331@gmail.com> Co-authored-by: Paillat <jeremiecotti@ik.me> Co-authored-by: Lala Sabathil <lala@pycord.dev> * Revert "fix: support emoji aliases like `😄` in PartialEmoji.from_str" (Pycord-Development#2814) Revert "fix: support emoji aliases like `:smile:` in PartialEmoji.from_str (#…" This reverts commit 735673b. * Apply suggestions from code review Signed-off-by: Paillat <jeremiecotti@ik.me> * Update discord/utils.py Signed-off-by: Paillat <jeremiecotti@ik.me> * Update discord/utils.py Signed-off-by: Paillat <jeremiecotti@ik.me> * Update discord/ext/commands/flags.py Signed-off-by: Paillat <jeremiecotti@ik.me> * 🚨 Fix linter warnings --------- Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> Signed-off-by: Hema2 <49586027+Hema2-official@users.noreply.github.com> Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Lala Sabathil <aiko@aitsys.dev> Signed-off-by: Paillat <me@paillat.dev> Signed-off-by: Paillat <jeremiecotti@ik.me> Signed-off-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com> Co-authored-by: Lumouille <144063653+Lumabots@users.noreply.github.com> Co-authored-by: UK <41271523+NeloBlivion@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Hema2 <49586027+Hema2-official@users.noreply.github.com> Co-authored-by: Lala Sabathil <lala@pycord.dev> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lala Sabathil <aiko@aitsys.dev> Co-authored-by: DA344 <108473820+DA-344@users.noreply.github.com> Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Co-authored-by: plun1331 <plun1331@gmail.com> Co-authored-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
1 parent 160f5f4 commit 2078cef

30 files changed

+1247
-124
lines changed

.github/workflows/docs-localization-download.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
working-directory: ./docs
4242
- name: "Crowdin"
4343
id: crowdin
44-
uses: crowdin/github-action@v2.7.0
44+
uses: crowdin/github-action@v2.7.1
4545
with:
4646
upload_sources: false
4747
upload_translations: false

.github/workflows/docs-localization-upload.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
sphinx-intl update -p ./build/locales ${{ vars.SPHINX_LANGUAGES }}
4646
working-directory: ./docs
4747
- name: "Crowdin"
48-
uses: crowdin/github-action@v2.7.0
48+
uses: crowdin/github-action@v2.7.1
4949
with:
5050
upload_sources: true
5151
upload_translations: false

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ These changes are available on the `master` branch, but have not yet been releas
5353
([#2598](https://github.com/Pycord-Development/pycord/pull/2598))
5454
- Added the ability to change the API's base URL with `Route.API_BASE_URL`.
5555
([#2714](https://github.com/Pycord-Development/pycord/pull/2714))
56-
- Added the ability to pass a `datetime.time` object to `format_dt`
56+
- Added the ability to pass a `datetime.time` object to `format_dt`.
5757
([#2747](https://github.com/Pycord-Development/pycord/pull/2747))
58+
- Added `discord.Interaction.created_at`.
59+
([#2801](https://github.com/Pycord-Development/pycord/pull/2801))
5860

5961
### Fixed
6062

@@ -105,12 +107,18 @@ These changes are available on the `master` branch, but have not yet been releas
105107
([#2739](https://github.com/Pycord-Development/pycord/pull/2739))
106108
- Fixed missing `None` type hints in `Select.__init__`.
107109
([#2746](https://github.com/Pycord-Development/pycord/pull/2746))
110+
- Fixed `TypeError` when using `Flag` with Python 3.11+.
111+
([#2759](https://github.com/Pycord-Development/pycord/pull/2759))
112+
- Fixed `TypeError` when specifying `thread_name` in `Webhook.send`.
113+
([#2761](https://github.com/Pycord-Development/pycord/pull/2761))
108114
- Updated `valid_locales` to support `in` and `es-419`.
109115
([#2767](https://github.com/Pycord-Development/pycord/pull/2767))
110116
- Fixed `Webhook.edit` not working with `attachments=[]`.
111117
([#2779](https://github.com/Pycord-Development/pycord/pull/2779))
112118
- Fixed GIF-based `Sticker` returning the wrong `url`.
113119
([#2781](https://github.com/Pycord-Development/pycord/pull/2781))
120+
- Fixed `VoiceClient` crashing randomly while receiving audio
121+
([#2800](https://github.com/Pycord-Development/pycord/pull/2800))
114122

115123
### Changed
116124

@@ -140,6 +148,11 @@ These changes are available on the `master` branch, but have not yet been releas
140148
- Deprecated `Interaction.cached_channel` in favor of `Interaction.channel`.
141149
([#2658](https://github.com/Pycord-Development/pycord/pull/2658))
142150

151+
### Removed
152+
153+
- Removed deprecated support for `Option` in `BridgeCommand`. Use `BridgeOption`
154+
instead. ([#2731])(https://github.com/Pycord-Development/pycord/pull/2731))
155+
143156
## [2.6.1] - 2024-09-15
144157

145158
### Fixed

discord/abc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1526,7 +1526,7 @@ async def send(
15261526
if reference is not None:
15271527
try:
15281528
_reference = reference.to_message_reference_dict()
1529-
from .message import MessageReference
1529+
from .message import MessageReference # noqa: PLC0415
15301530

15311531
if not isinstance(reference, MessageReference):
15321532
utils.warn_deprecated(

discord/appinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class AppInfo:
182182
)
183183

184184
def __init__(self, state: ConnectionState, data: AppInfoPayload):
185-
from .team import Team
185+
from .team import Team # noqa: PLC0415
186186

187187
self._state: ConnectionState = state
188188
self.id: int = int(data["id"])

discord/audit_logs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def __init__(
335335
before = transformer(entry, before)
336336

337337
if attr == "location" and hasattr(self.before, "location_type"):
338-
from .scheduled_events import ScheduledEventLocation
338+
from .scheduled_events import ScheduledEventLocation # noqa: PLC0415
339339

340340
if self.before.location_type is enums.ScheduledEventLocationType.external:
341341
before = ScheduledEventLocation(state=state, value=before)
@@ -353,7 +353,7 @@ def __init__(
353353
after = transformer(entry, after)
354354

355355
if attr == "location" and hasattr(self.after, "location_type"):
356-
from .scheduled_events import ScheduledEventLocation
356+
from .scheduled_events import ScheduledEventLocation # noqa: PLC0415
357357

358358
if self.after.location_type is enums.ScheduledEventLocationType.external:
359359
after = ScheduledEventLocation(state=state, value=after)

discord/bot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def _check_command(cmd: ApplicationCommand, match: Mapping[str, Any]) -> bool:
293293
"integration_types": None,
294294
}
295295
for check, value in to_check.items():
296-
if type(to_check[check]) == list:
296+
if type(value) == list:
297297
# We need to do some falsy conversion here
298298
# The API considers False (autocomplete) and [] (choices) to be falsy values
299299
falsy_vals = (False, [])
@@ -357,12 +357,12 @@ def _check_command(cmd: ApplicationCommand, match: Mapping[str, Any]) -> bool:
357357

358358
# Now let's see if there are any commands on discord that we need to delete
359359
for cmd, value_ in registered_commands_dict.items():
360-
match = get(pending, name=registered_commands_dict[cmd]["name"])
360+
match = get(pending, name=value_["name"])
361361
if match is None:
362362
# We have this command registered but not in our list
363363
return_value.append(
364364
{
365-
"command": registered_commands_dict[cmd]["name"],
365+
"command": value_["name"],
366366
"id": int(value_["id"]),
367367
"action": "delete",
368368
}

discord/channel.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ async def webhooks(self) -> list[Webhook]:
457457
You don't have permissions to get the webhooks.
458458
"""
459459

460-
from .webhook import Webhook
460+
from .webhook import Webhook # noqa: PLC0415
461461

462462
data = await self._state.http.channel_webhooks(self.id)
463463
return [Webhook.from_state(d, state=self._state) for d in data]
@@ -495,7 +495,7 @@ async def create_webhook(self, *, name: str, avatar: bytes | None = None, reason
495495
You do not have permissions to create a webhook.
496496
"""
497497

498-
from .webhook import Webhook
498+
from .webhook import Webhook # noqa: PLC0415
499499

500500
if avatar is not None:
501501
avatar = utils._bytes_to_base64_data(avatar) # type: ignore
@@ -544,7 +544,7 @@ async def follow(self, *, destination: TextChannel, reason: str | None = None) -
544544
if not isinstance(destination, TextChannel):
545545
raise InvalidArgument(f"Expected TextChannel received {destination.__class__.__name__}")
546546

547-
from .webhook import Webhook
547+
from .webhook import Webhook # noqa: PLC0415
548548

549549
data = await self._state.http.follow_webhook(self.id, webhook_channel_id=destination.id, reason=reason)
550550
return Webhook._as_follower(data, channel=destination, user=self._state.user)
@@ -568,7 +568,7 @@ def get_partial_message(self, message_id: int, /) -> PartialMessage:
568568
The partial message.
569569
"""
570570

571-
from .message import PartialMessage
571+
from .message import PartialMessage # noqa: PLC0415
572572

573573
return PartialMessage(channel=self, id=message_id)
574574

@@ -1740,7 +1740,7 @@ def get_partial_message(self, message_id: int, /) -> PartialMessage:
17401740
The partial message.
17411741
"""
17421742

1743-
from .message import PartialMessage
1743+
from .message import PartialMessage # noqa: PLC0415
17441744

17451745
return PartialMessage(channel=self, id=message_id)
17461746

@@ -1895,7 +1895,7 @@ async def webhooks(self) -> list[Webhook]:
18951895
You don't have permissions to get the webhooks.
18961896
"""
18971897

1898-
from .webhook import Webhook
1898+
from .webhook import Webhook # noqa: PLC0415
18991899

19001900
data = await self._state.http.channel_webhooks(self.id)
19011901
return [Webhook.from_state(d, state=self._state) for d in data]
@@ -1933,7 +1933,7 @@ async def create_webhook(self, *, name: str, avatar: bytes | None = None, reason
19331933
You do not have permissions to create a webhook.
19341934
"""
19351935

1936-
from .webhook import Webhook
1936+
from .webhook import Webhook # noqa: PLC0415
19371937

19381938
if avatar is not None:
19391939
avatar = utils._bytes_to_base64_data(avatar) # type: ignore
@@ -2267,7 +2267,7 @@ def get_partial_message(self, message_id: int, /) -> PartialMessage:
22672267
The partial message.
22682268
"""
22692269

2270-
from .message import PartialMessage
2270+
from .message import PartialMessage # noqa: PLC0415
22712271

22722272
return PartialMessage(channel=self, id=message_id)
22732273

@@ -2422,7 +2422,7 @@ async def webhooks(self) -> list[Webhook]:
24222422
You don't have permissions to get the webhooks.
24232423
"""
24242424

2425-
from .webhook import Webhook
2425+
from .webhook import Webhook # noqa: PLC0415
24262426

24272427
data = await self._state.http.channel_webhooks(self.id)
24282428
return [Webhook.from_state(d, state=self._state) for d in data]
@@ -2460,7 +2460,7 @@ async def create_webhook(self, *, name: str, avatar: bytes | None = None, reason
24602460
You do not have permissions to create a webhook.
24612461
"""
24622462

2463-
from .webhook import Webhook
2463+
from .webhook import Webhook # noqa: PLC0415
24642464

24652465
if avatar is not None:
24662466
avatar = utils._bytes_to_base64_data(avatar) # type: ignore
@@ -3051,7 +3051,7 @@ def get_partial_message(self, message_id: int, /) -> PartialMessage:
30513051
The partial message.
30523052
"""
30533053

3054-
from .message import PartialMessage
3054+
from .message import PartialMessage # noqa: PLC0415
30553055

30563056
return PartialMessage(channel=self, id=message_id)
30573057

@@ -3274,7 +3274,7 @@ def get_partial_message(self, message_id: int, /) -> PartialMessage:
32743274
The partial message.
32753275
"""
32763276

3277-
from .message import PartialMessage
3277+
from .message import PartialMessage # noqa: PLC0415
32783278

32793279
return PartialMessage(channel=self, id=message_id)
32803280

discord/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ def get_stage_instance(self, id: int, /) -> StageInstance | None:
976976
Optional[:class:`.StageInstance`]
977977
The stage instance or ``None`` if not found.
978978
"""
979-
from .channel import StageChannel
979+
from .channel import StageChannel # noqa: PLC0415
980980

981981
channel = self._connection.get_channel(id)
982982

discord/commands/core.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110

111111

112112
def wrap_callback(coro):
113-
from ..ext.commands.errors import CommandError
113+
from ..ext.commands.errors import CommandError # noqa: PLC0415
114114

115115
@functools.wraps(coro)
116116
async def wrapped(*args, **kwargs):
@@ -130,7 +130,7 @@ async def wrapped(*args, **kwargs):
130130

131131

132132
def hooked_wrapped_callback(command, ctx, coro):
133-
from ..ext.commands.errors import CommandError
133+
from ..ext.commands.errors import CommandError # noqa: PLC0415
134134

135135
@functools.wraps(coro)
136136
async def wrapped(arg):
@@ -187,7 +187,7 @@ class ApplicationCommand(_BaseCommand, Generic[CogT, P, T]):
187187
cog = None
188188

189189
def __init__(self, func: Callable, **kwargs) -> None:
190-
from ..ext.commands.cooldowns import BucketType, CooldownMapping, MaxConcurrency
190+
from ..ext.commands.cooldowns import BucketType, CooldownMapping, MaxConcurrency # noqa: PLC0415
191191

192192
cooldown = getattr(func, "__commands_cooldown__", kwargs.get("cooldown"))
193193

@@ -329,7 +329,7 @@ def _prepare_cooldowns(self, ctx: ApplicationContext):
329329
retry_after = bucket.update_rate_limit(current)
330330

331331
if retry_after:
332-
from ..ext.commands.errors import CommandOnCooldown
332+
from ..ext.commands.errors import CommandOnCooldown # noqa: PLC0415
333333

334334
raise CommandOnCooldown(bucket, retry_after, self._buckets.type) # type: ignore
335335

@@ -981,7 +981,7 @@ async def _invoke(self, ctx: ApplicationContext) -> None:
981981
arg = Object(id=int(arg))
982982

983983
elif op.input_type == SlashCommandOptionType.string and (converter := op.converter) is not None:
984-
from discord.ext.commands import Converter
984+
from discord.ext.commands import Converter # noqa: PLC0415
985985

986986
if isinstance(converter, Converter):
987987
if isinstance(converter, type):
@@ -1206,7 +1206,7 @@ def __init__(
12061206
self.description_localizations: dict[str, str] = kwargs.get("description_localizations", MISSING)
12071207

12081208
# similar to ApplicationCommand
1209-
from ..ext.commands.cooldowns import BucketType, CooldownMapping, MaxConcurrency
1209+
from ..ext.commands.cooldowns import BucketType, CooldownMapping, MaxConcurrency # noqa: PLC0415
12101210

12111211
# no need to getattr, since slash cmds groups cant be created using a decorator
12121212

0 commit comments

Comments
 (0)