fix: fix sticker items and add to forwards#28
Conversation
|
Warning Review limit reached
More reviews will be available in 49 minutes and 35 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR extends sticker handling across the Discord API layer to track and use ChangesSticker Format Type Support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
discord_http/sticker.py (1)
22-27:⚠️ Potential issue | 🟠 Major | ⚡ Quick winFix
PLW0244by removing inheritedformat_typefromSticker.__slots__.Ruff reports only
PLW0244at line 211:Slot format_type redefined from base class PartialSticker. Remove"format_type"fromclass Sticker.__slots__(keep it only inPartialSticker;Sticker.__init__already forwardsformat_typetosuper()), so URL/type behavior remains unchanged.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@discord_http/sticker.py` around lines 22 - 27, Sticker.__slots__ currently re-declares "format_type" which duplicates the slot defined in PartialSticker and triggers PLW0244; remove "format_type" from Sticker.__slots__ so it only contains "_state", "guild_id", and "name" and let Sticker.__init__ continue forwarding format_type to super() (PartialSticker keeps the format_type slot) to preserve URL/type behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@discord_http/message.py`:
- Around line 1544-1547: The MessageSnapshot code is reading stickers from the
root payload (data.get("sticker_items", [])) which misses snapshot stickers
nested under the "message" key; update the sticker parsing in MessageSnapshot
(in _from_data) to read from the nested message object (e.g. use the "message"
dict's "sticker_items") when constructing PartialSticker instances so forwarded
snapshots populate MessageSnapshot.stickers correctly.
---
Outside diff comments:
In `@discord_http/sticker.py`:
- Around line 22-27: Sticker.__slots__ currently re-declares "format_type" which
duplicates the slot defined in PartialSticker and triggers PLW0244; remove
"format_type" from Sticker.__slots__ so it only contains "_state", "guild_id",
and "name" and let Sticker.__init__ continue forwarding format_type to super()
(PartialSticker keeps the format_type slot) to preserve URL/type behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 44ae8a46-29c4-4172-a22d-7c1cd4955e89
📒 Files selected for processing (2)
discord_http/message.pydiscord_http/sticker.py
|
Other linting lines from Ruff aren't related to this PR |
Description
Sticker items have format types, and also messane snapshots show these, good for getting the URL properly.
Summary by CodeRabbit
Bug Fixes