Skip to content

Commit c5cb487

Browse files
authored
Merge branch 'master' into optional-option
Signed-off-by: Lumouille <[email protected]>
2 parents d467901 + 97ed68e commit c5cb487

27 files changed

+493
-105
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
* @Pycord-Development/maintainers
1+
* @Pycord-Development/library-maintainers @Pycord-Development/library-contributors
22

33
/discord/ @Pycord-Development/maintain-discord-api
44

.github/SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
| Version | Supported |
66
| ------- | ------------------ |
77
| 2.x | :white_check_mark: |
8-
| <2.0.0 | :x: |
8+
| <2.6.1 | :x: |
99

1010
## Reporting a Vulnerability
1111

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Docs JSON Export
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
jobs:
10+
export-docs-json:
11+
name: Export docs.json
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
id: checkout
16+
uses: actions/checkout@v5
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
id: setup-python
20+
with:
21+
python-version: "3.13"
22+
cache: "pip"
23+
cache-dependency-path: "requirements/docs.txt"
24+
check-latest: true
25+
- name: Install dependencies
26+
id: install-deps
27+
run: |
28+
python -m pip install -U pip
29+
pip install ".[docs]"
30+
pip install beautifulsoup4
31+
- name: Build Sphinx HTML docs
32+
id: build-sphinx
33+
run: sphinx-build -b html docs docs/_build/html
34+
- name: Export docs.json
35+
id: generate-json
36+
run: python scripts/docs_json_exporter.py
37+
- name: Upload docs.json as artifact
38+
uses: actions/[email protected]
39+
id: artifact-upload
40+
with:
41+
name: Pycord Docs JSON
42+
path: docs.json
43+
retention-days: 1
44+
- name: Show docs.json summary
45+
run: |
46+
head -n 40 docs.json || tail -n 40 docs.json
47+
- name: Output artifact ID
48+
run: |
49+
echo "artifact-id=${{ steps.artifact-upload.outputs.artifact-id }}" >> $GITHUB_OUTPUT
50+
echo "artifact-url=${{ steps.artifact-upload.outputs.artifact-url }}" >> $GITHUB_OUTPUT
51+
echo "::notice::Artifact uploaded: ${{ steps.artifact-upload.outputs.artifact-url }}"

.github/workflows/release.yml

Lines changed: 194 additions & 46 deletions
Large diffs are not rendered by default.

CHANGELOG.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ possible (see our [Version Guarantees] for more info).
1010

1111
These changes are available on the `master` branch, but have not yet been released.
1212

13+
### Added
14+
15+
### Changed
16+
17+
### Fixed
18+
19+
- Manage silence for new SSRC with existing user_id.
20+
([#2808](https://github.com/Pycord-Development/pycord/pull/2808))
21+
22+
### Removed
23+
24+
## [2.7.0rc1] - 2025-08-30
25+
1326
⚠️ **This version removes support for Python 3.8.** ⚠️
1427

1528
### Added
@@ -167,6 +180,9 @@ These changes are available on the `master` branch, but have not yet been releas
167180
([#2878](https://github.com/Pycord-Development/pycord/pull/2878))
168181
- Fixed `AttributeError` when accessing `AuditLogEntry.changes` more than once.
169182
([#2882])(https://github.com/Pycord-Development/pycord/pull/2882))
183+
- Fixed type hint for argument `start_time` and `end_time` of
184+
`Guild.create_scheduled_event`
185+
([#2879](https://github.com/Pycord-Development/pycord/pull/2879))
170186

171187
### Changed
172188

@@ -1113,7 +1129,8 @@ These changes are available on the `master` branch, but have not yet been releas
11131129
- Fix py3.10 UnionType checks issue.
11141130
([#1240](https://github.com/Pycord-Development/pycord/pull/1240))
11151131

1116-
[unreleased]: https://github.com/Pycord-Development/pycord/compare/v2.6.1...HEAD
1132+
[unreleased]: https://github.com/Pycord-Development/pycord/compare/v2.7.0rc1...HEAD
1133+
[2.7.0rc1]: https://github.com/Pycord-Development/pycord/compare/v2.6.0...v2.7.0rc1
11171134
[2.6.1]: https://github.com/Pycord-Development/pycord/compare/v2.6.0...v2.6.1
11181135
[2.6.0]: https://github.com/Pycord-Development/pycord/compare/v2.5.0...v2.6.0
11191136
[2.5.0]: https://github.com/Pycord-Development/pycord/compare/v2.4.1...v2.5.0

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ Pycord is a modern, easy to use, feature-rich, and async ready API wrapper for D
1717
.. image:: https://img.shields.io/github/v/release/Pycord-Development/pycord?include_prereleases&label=Latest%20Release&logo=github&sort=semver&style=for-the-badge&logoColor=white
1818
:target: https://github.com/Pycord-Development/pycord/releases
1919
:alt: Latest release
20-
2120
.. image:: https://img.shields.io/discord/881207955029110855?label=discord&style=for-the-badge&logo=discord&color=5865F2&logoColor=white
2221
:target: https://pycord.dev/discord
2322
:alt: Discord server invite
24-
23+
.. image:: https://img.shields.io/github/sponsors/Pycord-Development?style=for-the-badge
24+
:target: https://github.com/sponsors/Pycord-Development
25+
:alt: GitHub Sponsors
2526
.. image:: https://badges.crowdin.net/badge/dark/crowdin-on-light.png
2627
:target: https://translations.pycord.dev/documentation/?utm_source=badge&utm_medium=referral&utm_campaign=badge-add-on
2728
:alt: Crowdin | Agile localization for tech companies

discord/asset.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,18 @@ def _from_cover_image(cls, state, object_id: int, cover_image_hash: str) -> Asse
274274
animated=False,
275275
)
276276

277+
@classmethod
278+
def _from_collectible(
279+
cls, state: ConnectionState, asset: str, animated: bool = False
280+
) -> Asset:
281+
name = "static.png" if not animated else "asset.webm"
282+
return cls(
283+
state,
284+
url=f"{cls.BASE}/assets/collectibles/{asset}{name}",
285+
key=asset,
286+
animated=animated,
287+
)
288+
277289
@classmethod
278290
def _from_guild_image(cls, state, guild_id: int, image: str, path: str) -> Asset:
279291
animated = False

discord/channel.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2884,8 +2884,6 @@ class CategoryChannel(discord.abc.GuildChannel, Hashable):
28842884
The position in the category list. This is a number that starts at 0. e.g. the
28852885
top category is position 0. Can be ``None`` if the channel was received in an interaction.
28862886
2887-
.. note::
2888-
28892887
flags: :class:`ChannelFlags`
28902888
Extra features of the channel.
28912889

discord/client.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
if TYPE_CHECKING:
7070
from .abc import GuildChannel, PrivateChannel, Snowflake, SnowflakeTime
7171
from .channel import DMChannel
72-
from .interaction import Interaction
72+
from .interactions import Interaction
7373
from .member import Member
7474
from .message import Message
7575
from .poll import Poll
@@ -553,6 +553,15 @@ async def on_view_error(
553553
The default view error handler provided by the client.
554554
555555
This only fires for a view if you did not define its :func:`~discord.ui.View.on_error`.
556+
557+
Parameters
558+
----------
559+
error: :class:`Exception`
560+
The exception that was raised.
561+
item: :class:`Item`
562+
The item that the user interacted with.
563+
interaction: :class:`Interaction`
564+
The interaction that was received.
556565
"""
557566

558567
print(
@@ -570,6 +579,13 @@ async def on_modal_error(self, error: Exception, interaction: Interaction) -> No
570579
The default implementation prints the traceback to stderr.
571580
572581
This only fires for a modal if you did not define its :func:`~discord.ui.Modal.on_error`.
582+
583+
Parameters
584+
----------
585+
error: :class:`Exception`
586+
The exception that was raised.
587+
interaction: :class:`Interaction`
588+
The interaction that was received.
573589
"""
574590

575591
print(f"Ignoring exception in modal {interaction.modal}:", file=sys.stderr)
@@ -1297,7 +1313,7 @@ def add_listener(self, func: Coro, name: str = MISSING) -> None:
12971313
TypeError
12981314
The ``func`` parameter is not a coroutine function.
12991315
ValueError
1300-
The ``name`` (event name) does not start with 'on_'
1316+
The ``name`` (event name) does not start with ``on_``.
13011317
13021318
Example
13031319
-------
@@ -1361,7 +1377,7 @@ def listen(self, name: str = MISSING, once: bool = False) -> Callable[[Coro], Co
13611377
TypeError
13621378
The function being listened to is not a coroutine.
13631379
ValueError
1364-
The ``name`` (event name) does not start with 'on_'
1380+
The ``name`` (event name) does not start with ``on_``.
13651381
13661382
Example
13671383
-------

discord/collectibles.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
DEALINGS IN THE SOFTWARE.
2323
"""
2424

25+
from functools import cached_property
2526
from typing import TYPE_CHECKING
2627

2728
if TYPE_CHECKING:
@@ -55,21 +56,23 @@ def __init__(self, data: NameplatePayload, state: "ConnectionState") -> None:
5556
def __repr__(self) -> str:
5657
return f"<Nameplate sku_id={self.sku_id} palette={self.palette}>"
5758

58-
def get_asset(self, animated: bool = False) -> Asset:
59-
"""Returns the asset of the nameplate.
59+
@cached_property
60+
def static_asset(self) -> Asset:
61+
"""
62+
The static :class:`Asset` of this nameplate.
63+
64+
.. versionadded:: 2.7
65+
"""
66+
return Asset._from_collectible(self._state, self._asset)
67+
68+
@cached_property
69+
def animated_asset(self) -> Asset:
70+
"""
71+
The animated :class:`Asset` of this nameplate.
6072
61-
Parameters
62-
----------
63-
animated: :class:`bool`
64-
Whether to return the animated version of the asset, in webm version. Defaults to ``False``.
73+
.. versionadded:: 2.7
6574
"""
66-
fn = "static.png" if not animated else "asset.webm"
67-
return Asset(
68-
state=self._state,
69-
url=f"{Asset.BASE}/assets/collectibles/{self._asset}{fn}",
70-
key=self._asset.split("/")[-1],
71-
animated=animated,
72-
)
75+
return Asset._from_collectible(self._state, self._asset, animated=True)
7376

7477

7578
__all__ = ("Nameplate",)

0 commit comments

Comments
 (0)