Skip to content

fix: deprecated use of dict methods on _PayloadLike classes#3189

Merged
Lulalaby merged 3 commits intoPycord-Development:masterfrom
Revnoplex:fix/internal-deprecated-payloadlike-method-use
Mar 30, 2026
Merged

fix: deprecated use of dict methods on _PayloadLike classes#3189
Lulalaby merged 3 commits intoPycord-Development:masterfrom
Revnoplex:fix/internal-deprecated-payloadlike-method-use

Conversation

@Revnoplex
Copy link
Copy Markdown
Contributor

@Revnoplex Revnoplex commented Mar 30, 2026

Caution

Feature freeze is active, as described by our Release Schedule.

Summary

Found deprecated use of dict operations on the _PayloadLike class RawVoiceStateUpdateEvent that emitted the following deprecation warning:

.venv/lib/python3.13/site-packages/discord/voice/state.py:349: DeprecationWarning: __getitem__ is deprecated since version 2.7 and will be removed in version 3.0. Consider using the attributes instead.
  self.session_id = data["session_id"]

This pr replaces it with the attribute data.session_id instead.
I traced usages of RawVoiceStateUpdateEvent and the other _PayloadLike class RawVoiceServerUpdateEvent with my IDE, but found no other usages of dict operations with them. But feel free to double check as I don't trust myself with my IDE's search functions

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.
  • AI Usage has been disclosed.
    • If AI has been used, I understand fully what the code does

@Revnoplex Revnoplex requested review from a team, Lulalaby and Lumabots March 30, 2026 12:19
@Revnoplex Revnoplex requested a review from a team as a code owner March 30, 2026 12:19
@github-project-automation github-project-automation bot moved this to Todo in Pycord Mar 30, 2026
@pycord-app
Copy link
Copy Markdown

pycord-app bot commented Mar 30, 2026

Thanks for opening this pull request!
Please make sure you have read the Contributing Guidelines and Code of Conduct.

This pull request can be checked-out with:

git fetch origin pull/3189/head:pr-3189
git checkout pr-3189

This pull request can be installed with:

pip install git+https://github.com/Pycord-Development/pycord@refs/pull/3189/head

@Revnoplex Revnoplex requested a review from a team as a code owner March 30, 2026 12:20
@Revnoplex Revnoplex requested review from a team, DA-344 and Icebluewolf March 30, 2026 12:20
@Lulalaby Lulalaby merged commit 405d15d into Pycord-Development:master Mar 30, 2026
4 of 6 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Pycord Mar 30, 2026
@Revnoplex
Copy link
Copy Markdown
Contributor Author

ah the unresponsive pre-commit check caused a styling issue to slip through and cause the pre-commit check to fail on master

@Revnoplex
Copy link
Copy Markdown
Contributor Author

Revnoplex commented Mar 30, 2026

doesn't matter now, it fixed the styling in the other pr when I updated it that just got merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants