Skip to content

Commit a0f2a99

Browse files
committed
Merge branch 'master' of https://github.com/Pycord-Development/pycord into feat/voice-rewrite-and-fixes
2 parents 109d27c + 14989c9 commit a0f2a99

File tree

17 files changed

+416
-127
lines changed

17 files changed

+416
-127
lines changed

.github/workflows/docs-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: "Checkout Repository"
3939
uses: actions/checkout@v5
4040
- name: "Setup Python"
41-
uses: actions/setup-python@v5
41+
uses: actions/setup-python@v6
4242
with:
4343
python-version: "3.13"
4444
cache: "pip"
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@v6
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/upload-artifact@v4.6.2
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/docs-localization-download.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
fetch-tags: true
2121
- name: "Install Python"
22-
uses: actions/setup-python@v5
22+
uses: actions/setup-python@v6
2323
with:
2424
python-version: "3.13"
2525
cache: "pip"
@@ -40,7 +40,7 @@ jobs:
4040
working-directory: ./docs
4141
- name: "Crowdin"
4242
id: crowdin
43-
uses: crowdin/github-action@v2.10.0
43+
uses: crowdin/github-action@v2.11.0
4444
with:
4545
upload_sources: false
4646
upload_translations: false

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
with:
2525
fetch-tags: true
2626
- name: "Install Python"
27-
uses: actions/setup-python@v5
27+
uses: actions/setup-python@v6
2828
with:
2929
python-version: "3.13"
3030
cache: "pip"
@@ -44,7 +44,7 @@ jobs:
4444
sphinx-intl update -p ./build/locales ${{ vars.SPHINX_LANGUAGES }}
4545
working-directory: ./docs
4646
- name: "Crowdin"
47-
uses: crowdin/github-action@v2.10.0
47+
uses: crowdin/github-action@v2.11.0
4848
with:
4949
upload_sources: true
5050
upload_translations: false

.github/workflows/lib-checks.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: "Checkout Repository"
3535
uses: actions/checkout@v5
3636
- name: "Setup Python"
37-
uses: actions/setup-python@v5
37+
uses: actions/setup-python@v6
3838
with:
3939
python-version: "3.13"
4040
cache: "pip"
@@ -54,7 +54,7 @@ jobs:
5454
- name: "Checkout Repository"
5555
uses: actions/checkout@v5
5656
- name: "Setup Python"
57-
uses: actions/setup-python@v5
57+
uses: actions/setup-python@v6
5858
with:
5959
python-version: "3.13"
6060
cache: "pip"
@@ -72,7 +72,7 @@ jobs:
7272
- name: "Checkout Repository"
7373
uses: actions/checkout@v5
7474
- name: "Setup Python"
75-
uses: actions/setup-python@v5
75+
uses: actions/setup-python@v6
7676
with:
7777
python-version: "3.13"
7878
cache: "pip"
@@ -96,7 +96,7 @@ jobs:
9696
- name: "Checkout Repository"
9797
uses: actions/checkout@v5
9898
- name: "Setup Python"
99-
uses: actions/setup-python@v5
99+
uses: actions/setup-python@v6
100100
with:
101101
python-version: "3.13"
102102
cache: "pip"
@@ -133,7 +133,7 @@ jobs:
133133
- name: "Checkout Repository"
134134
uses: actions/checkout@v5
135135
- name: "Setup Python"
136-
uses: actions/setup-python@v5
136+
uses: actions/setup-python@v6
137137
with:
138138
python-version: ${{ matrix.python-version }}
139139
cache: "pip"

.github/workflows/release.yml

Lines changed: 86 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -41,31 +41,63 @@ jobs:
4141
env:
4242
VERSION: ${{ github.event.inputs.version }}
4343
run: |
44-
# PEP 440 version regex
4544
VALID_VERSION_REGEX='^([0-9]+\.[0-9]+\.[0-9]+((a|b|rc|\.dev|\.post)[0-9]+)?)$'
4645
if ! [[ $VERSION =~ $VALID_VERSION_REGEX ]]; then
4746
echo "::error::Invalid version string '$VERSION'. Must match PEP 440 (e.g. 1.2.0, 1.2.0rc1, 1.2.0.dev1, 1.2.0a1, 1.2.0b1, 1.2.0.post1)"
4847
exit 1
4948
fi
49+
if ! [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && ! [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+rc[0-9]+$ ]]; then
50+
echo "::error::Unsupported version string '$VERSION'. Only normal releases (e.g. 1.2.3) and rc (e.g. 1.2.3rc1) are supported at this time."
51+
exit 1
52+
fi
5053
echo "version=$VERSION" >> $GITHUB_OUTPUT
5154
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^)
5255
echo "previous_tag=${PREVIOUS_TAG}" >> $GITHUB_OUTPUT
53-
if [[ $VERSION =~ rc[0-9]+$ ]]; then
54-
MAJOR_MINOR_VERSION=$(echo $VERSION | grep -oE '^[0-9]+\.[0-9]+')
55-
echo "branch_name=v${MAJOR_MINOR_VERSION}.x" >> $GITHUB_OUTPUT
56+
MAJOR_MINOR_VERSION=$(echo $VERSION | grep -oE '^[0-9]+\.[0-9]+')
57+
echo "branch_name=v${MAJOR_MINOR_VERSION}.x" >> $GITHUB_OUTPUT
58+
if [[ $VERSION == *rc* ]]; then
5659
echo "is_rc=true" >> $GITHUB_OUTPUT
57-
elif [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
58-
MAJOR_MINOR_VERSION=$(echo $VERSION | grep -oE '^[0-9]+\.[0-9]+')
59-
echo "branch_name=v${MAJOR_MINOR_VERSION}.x" >> $GITHUB_OUTPUT
60-
echo "is_rc=false" >> $GITHUB_OUTPUT
6160
else
62-
MAJOR_MINOR_VERSION=$(echo $VERSION | grep -oE '^[0-9]+\.[0-9]+')
63-
echo "branch_name=v${MAJOR_MINOR_VERSION}.x" >> $GITHUB_OUTPUT
6461
echo "is_rc=false" >> $GITHUB_OUTPUT
6562
fi
6663
64+
branch_protection_rename:
65+
needs: [safety_check]
66+
runs-on: ubuntu-latest
67+
environment: release
68+
env:
69+
GH_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
70+
outputs:
71+
master_rule_id: ${{ steps.get_rule_ids.outputs.master_rule_id }}
72+
master_pattern: ${{ steps.get_rule_ids.outputs.master_pattern }}
73+
v_rule_id: ${{ steps.get_rule_ids.outputs.v_rule_id }}
74+
v_pattern: ${{ steps.get_rule_ids.outputs.v_pattern }}
75+
steps:
76+
- name: Get branch protection rule IDs
77+
id: get_rule_ids
78+
run: |
79+
gh api repos/${{ github.repository }}/branch-protection-rules > rules.json
80+
MASTER_ID=$(jq -r '.[] | select(.pattern == "master") | .id' rules.json)
81+
MASTER_PATTERN=$(jq -r '.[] | select(.pattern == "master") | .pattern' rules.json)
82+
V_ID=$(jq -r '.[] | select(.pattern | test("^v[0-9]+\\.[0-9]+\\.x$")) | .id' rules.json)
83+
V_PATTERN=$(jq -r '.[] | select(.pattern | test("^v[0-9]+\\.[0-9]+\\.x$")) | .pattern' rules.json)
84+
echo "master_rule_id=$MASTER_ID" >> $GITHUB_OUTPUT
85+
echo "master_pattern=$MASTER_PATTERN" >> $GITHUB_OUTPUT
86+
echo "v_rule_id=$V_ID" >> $GITHUB_OUTPUT
87+
echo "v_pattern=$V_PATTERN" >> $GITHUB_OUTPUT
88+
- name: Rename master protection to temp-master
89+
if: ${{ steps.get_rule_ids.outputs.master_rule_id != '' }}
90+
run: |
91+
gh api repos/${{ github.repository }}/branch-protection-rules/${{ steps.get_rule_ids.outputs.master_rule_id }} \
92+
-X PATCH -F pattern="temp-master"
93+
- name: Rename v*.* protection to temp-v
94+
if: ${{ steps.get_rule_ids.outputs.v_rule_id != '' }}
95+
run: |
96+
gh api repos/${{ github.repository }}/branch-protection-rules/${{ steps.get_rule_ids.outputs.v_rule_id }} \
97+
-X PATCH -F pattern="temp-v"
98+
6799
lib_release:
68-
needs: [safety_check,pre_config]
100+
needs: [pre_config, branch_protection_rename]
69101
runs-on: ubuntu-latest
70102
environment: release
71103
env:
@@ -91,7 +123,7 @@ jobs:
91123
git checkout $VERSION_BRANCH
92124
- name: "Setup Python"
93125
id: python-setup
94-
uses: actions/setup-python@v5
126+
uses: actions/setup-python@v6
95127
with:
96128
python-version: "3.13"
97129
cache: "pip"
@@ -119,7 +151,7 @@ jobs:
119151
DATE=$(date +'%Y-%m-%d')
120152
sed -i "/These changes are available on the \`.*\` branch, but have not yet been released\./{N;d;}" CHANGELOG.md
121153
sed -i "s/## \[Unreleased\]/## [$VERSION] - $DATE/" CHANGELOG.md
122-
sed -i "0,/## \[$VERSION\]/ s|## \[$VERSION\]|## [Unreleased]\n\nThese changes are available on the \`$BRANCH\` branch, but have not yet been released.\n\n### Added\n\n### Changed\n\n### Fixed\n\n### Removed\n\n&|" CHANGELOG.md
154+
sed -i "0,/## \[$VERSION\]/ s|## \[$VERSION\]|## [Unreleased]\n\nThese changes are available on the \`$BRANCH\` branch, but have not yet been released.\n\n### Added\n\n### Changed\n\n### Fixed\n\n### Deprecated\n\n### Removed\n\n&|" CHANGELOG.md
123155
sed -i "s|\[unreleased\]:.*|[unreleased]: https://github.com/$REPOSITORY/compare/v$VERSION...HEAD\n[$VERSION]: https://github.com/$REPOSITORY/compare/$(git describe --tags --abbrev=0 @^)...v$VERSION|" CHANGELOG.md
124156
git add CHANGELOG.md
125157
git commit -m "chore(release): update CHANGELOG.md for version $VERSION"
@@ -166,7 +198,7 @@ jobs:
166198
python3 -m build --sdist
167199
python3 -m build --wheel
168200
- name: "Create GitHub Release"
169-
uses: softprops/action-gh-release@v2.3.2
201+
uses: softprops/action-gh-release@v2.3.3
170202
id: gh-release
171203
with:
172204
tag_name: "v${{ inputs.version }}"
@@ -183,7 +215,7 @@ jobs:
183215
target_commitish: ${{ github.ref_name }}
184216

185217
- name: "Publish package distributions to PyPI"
186-
uses: pypa/gh-action-pypi-publish@v1.12.4
218+
uses: pypa/gh-action-pypi-publish@v1.13.0
187219
env:
188220
name: "pypi"
189221
url: "https://pypi.org/p/py-cord"
@@ -193,14 +225,15 @@ jobs:
193225
attestations: false
194226
verify-metadata: false
195227

196-
197228
- name: "Echo release url"
198229
run: echo "${{ steps.gh-release.outputs.url }}"
199230

200231
docs_release:
201232
runs-on: ubuntu-latest
202-
needs: [lib_release,pre_config]
203-
if: ${{ needs.pre_config.outputs.is_rc == 'false' || (needs.pre_config.outputs.is_rc == 'true' && endsWith(needs.pre_config.outputs.version, '0rc1')) }}
233+
needs: [lib_release, pre_config]
234+
if:
235+
${{ needs.pre_config.outputs.is_rc == 'false' || (needs.pre_config.outputs.is_rc
236+
== 'true' && endsWith(needs.pre_config.outputs.version, '0rc1')) }}
204237
environment: release
205238
steps:
206239
- name: "Sync Versions on Read the Docs"
@@ -213,6 +246,7 @@ jobs:
213246
run: |
214247
VERSION=${{ needs.pre_config.outputs.version }}
215248
MAJOR_MINOR_VERSION=$(echo $VERSION | grep -oE '^[0-9]+\.[0-9]+')
249+
HIDDEN=$([[ $VERSION == *rc* ]] && echo true || echo false)
216250
if [[ $VERSION == *rc* ]]; then
217251
DOCS_VERSION="v${MAJOR_MINOR_VERSION}.x"
218252
else
@@ -223,48 +257,45 @@ jobs:
223257
--header "Authorization: Token ${{ secrets.READTHEDOCS_TOKEN }}" \
224258
--data '{
225259
"active": true,
226-
"hidden": false
260+
"hidden": $HIDDEN
227261
}'
228262
229263
inform_discord:
230264
runs-on: ubuntu-latest
231-
needs: [lib_release,docs_release,pre_config]
265+
needs: [docs_release, lib_release, pre_config]
232266
environment: release
233267
steps:
234268
- name: "Notify Discord"
235269
run: |
236270
VERSION=${{ needs.pre_config.outputs.version }}
237271
MAJOR_MINOR_VERSION=$(echo $VERSION | grep -oE '^[0-9]+\.[0-9]+')
238-
if [[ $VERSION == *rc* ]]; then
239-
DOCS_URL="<https://docs.pycord.dev/en/v${MAJOR_MINOR_VERSION}.x/changelog.html>"
240-
else
241-
DOCS_URL="<https://docs.pycord.dev/en/v$VERSION/changelog.html>"
242-
fi
272+
DOCS_URL="<https://docs.pycord.dev/en/v$VERSION/changelog.html>"
243273
GITHUB_COMPARE_URL="<https://github.com/Pycord-Development/pycord/compare/${{ needs.pre_config.outputs.previous_tag }}...v$VERSION>"
244274
GITHUB_RELEASE_URL="<https://github.com/Pycord-Development/pycord/releases/tag/v$VERSION>"
245275
PYPI_RELEASE_URL="<https://pypi.org/project/py-cord/$VERSION/>"
246276
if [[ $VERSION == *rc* ]]; then
247-
ANNOUNCEMENT="## <:pycord:1063211537008955495> Pycord v${MAJOR_MINOR_VERSION} Release Candidate ($VERSION) is available!\n\n"
277+
ANNOUNCEMENT="## <:pycord:1063211537008955495> Pycord v$VERSION Release Candidate ($MAJOR_MINOR_VERSION) is available!\n\n"
278+
ANNOUNCEMENT="${ANNOUNCEMENT}@here\n\n"
248279
ANNOUNCEMENT="${ANNOUNCEMENT}This is a pre-release (release candidate) for testing and feedback.\n\n"
249280
ANNOUNCEMENT="${ANNOUNCEMENT}You can view the changelog here: <$DOCS_URL>\n\n"
250281
ANNOUNCEMENT="${ANNOUNCEMENT}Check out the [GitHub changelog]($GITHUB_COMPARE_URL), [GitHub release page]($GITHUB_RELEASE_URL), and [PyPI release page]($PYPI_RELEASE_URL).\n\n"
251282
ANNOUNCEMENT="${ANNOUNCEMENT}You can install this version by running the following command:\n\`\`\`sh\npip install -U py-cord==$VERSION\n\`\`\`\n\n"
252-
ANNOUNCEMENT="${ANNOUNCEMENT}Please try it out and let us know your feedback or any issues!\n@here"
283+
ANNOUNCEMENT="${ANNOUNCEMENT}Please try it out and let us know your feedback or any issues!"
253284
else
254-
ANNOUNCEMENT="## <:pycord:1063211537008955495> Pycord v${MAJOR_MINOR_VERSION} is out!\n\n"
255-
ANNOUNCEMENT="${ANNOUNCEMENT}[@everyone]\n\n"
285+
ANNOUNCEMENT="## <:pycord:1063211537008955495> Pycord v${VERSION} is out!\n\n"
286+
ANNOUNCEMENT="${ANNOUNCEMENT}@everyone\n\n"
256287
ANNOUNCEMENT="${ANNOUNCEMENT}You can view the changelog here: <$DOCS_URL>\n\n"
257288
ANNOUNCEMENT="${ANNOUNCEMENT}Feel free to take a look at the [GitHub changelog]($GITHUB_COMPARE_URL), [GitHub release page]($GITHUB_RELEASE_URL) and the [PyPI release page]($PYPI_RELEASE_URL).\n\n"
258-
ANNOUNCEMENT="${ANNOUNCEMENT}You can install this version by running the following command:\n\`\`\`sh\npip install -U py-cord==$VERSION\n\`\`\`\n\n"
289+
ANNOUNCEMENT="${ANNOUNCEMENT}You can install this version by running the following command:\n\`\`\`sh\npip install -U py-cord==$VERSION\n\`\`\`"
259290
fi
260291
curl -H "Content-Type: application/json" \
261292
-X POST \
262-
-d "{\"content\":\"$ANNOUNCEMENT\",\"allowed_mentions\":{\"parse\": [\"everyone\"]}}" \
293+
-d "{\"content\":\"$ANNOUNCEMENT\",\"allowed_mentions\":{\"parse\":[\"everyone\",\"roles\"]}}" \
263294
${{ secrets.DISCORD_WEBHOOK_URL }}
264295
265296
determine_milestone_id:
266297
runs-on: ubuntu-latest
267-
needs: [lib_release,pre_config]
298+
needs: [lib_release, pre_config]
268299
if: ${{ !contains(needs.pre_config.outputs.version, '-') }}
269300
outputs:
270301
old_milestone_version: ${{ steps.extract_version.outputs.old_milestone_version }}
@@ -286,8 +317,10 @@ jobs:
286317
287318
close_milestone:
288319
runs-on: ubuntu-latest
289-
needs: [determine_milestone_id,pre_config]
290-
if: ${{ !contains(needs.pre_config.outputs.version, 'rc') && endsWith(needs.pre_config.outputs.version, '.0') }}
320+
needs: [determine_milestone_id, pre_config]
321+
if:
322+
${{ !contains(needs.pre_config.outputs.version, 'rc') &&
323+
endsWith(needs.pre_config.outputs.version, '.0') }}
291324
environment: release
292325
env:
293326
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -308,3 +341,22 @@ jobs:
308341
run: |
309342
gh extension install valeriobelli/gh-milestone
310343
gh milestone create "${{ needs.determine_milestone_id.outputs.new_milestone_version }}"
344+
345+
branch_protection_restore:
346+
runs-on: ubuntu-latest
347+
needs: [branch_protection_rename, lib_release, docs_release, inform_discord, determine_milestone_id, close_milestone]
348+
environment: release
349+
if: always()
350+
env:
351+
GH_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
352+
steps:
353+
- name: Restore master protection pattern
354+
if: ${{ needs.branch_protection_rename.outputs.master_rule_id != '' }}
355+
run: |
356+
gh api repos/${{ github.repository }}/branch-protection-rules/${{ needs.branch_protection_rename.outputs.master_rule_id }} \
357+
-X PATCH -F pattern="${{ needs.branch_protection_rename.outputs.master_pattern }}"
358+
- name: Restore v*.* protection pattern
359+
if: ${{ needs.branch_protection_rename.outputs.v_rule_id != '' }}
360+
run: |
361+
gh api repos/${{ github.repository }}/branch-protection-rules/${{ needs.branch_protection_rename.outputs.v_rule_id }} \
362+
-X PATCH -F pattern="${{ needs.branch_protection_rename.outputs.v_pattern }}"

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,23 @@ These changes are available on the `master` branch, but have not yet been releas
1212

1313
### Added
1414

15+
- Implemented `with_response` for interaction callbacks, adding
16+
`Interaction.callback.is_loading()` and `Interaction.callback.is_ephemeral()`.
17+
([#2711](https://github.com/Pycord-Development/pycord/pull/2711))
18+
- Added `RawMessageUpdateEvent.new_message` - message update events now contain full
19+
message objects ([#2780](https://github.com/Pycord-Development/pycord/pull/2780))
20+
1521
### Changed
1622

1723
### Fixed
1824

25+
- Manage silence for new SSRC with existing user_id.
26+
([#2808](https://github.com/Pycord-Development/pycord/pull/2808))
27+
- Unbound `raw` reference in `parse_message_update` causing errors on message updates.
28+
([#2905](https://github.com/Pycord-Development/pycord/pull/2905))
29+
- `view=None` in various methods causing an AttributeError.
30+
([#2915](https://github.com/Pycord-Development/pycord/pull/2915))
31+
1932
### Removed
2033

2134
## [2.7.0rc1] - 2025-08-30

0 commit comments

Comments
 (0)