disnake
disnake copied to clipboard
refactor!(activity): improve typing, remove redundancies, fix `Spotify` fields raising errors
Summary
Changes:
- Improve activity deserialization typing by explicitly specifying kwargs in
__init__s (no PEP 692 yet :/ ) - Move
created_atand timestamp propertiesstart,endinto common base class- This notably changes
Spotify.start/.end/.durationto optional, fixing an edge case as reported here
- This notably changes
- Fix
Activity.buttonstype, data received over gateway only contains button labels - Default to activity type
0 (= ActivityType.playing)instead of-1if not provided; previously, the API would silently discard presence updates withdisnake.Activity(name=...)without a type as activity type-1is unknown
Checklist
- [x] If code changes were made, then they have been tested
- [x] I have updated the documentation to reflect the changes
- [x] I have formatted the code properly by running
task lint - [x] I have type-checked the code by running
task pyright
- [x] This PR fixes an issue
- [ ] This PR adds something new (e.g. new method or parameters)
- [x] This PR is a breaking change (e.g. methods or parameters removed/renamed)
- [ ] This PR is not a code change (e.g. documentation, README, ...)