Skip to content

Conversation

@AstreaTSS
Copy link
Member

About

This PR attempts to properly work around a very strange bug that made some extensions break.

Basically:

  • Make an embed with a footer.
  • Initialize a Message and use the _json for the embed when specifying the embeds.
  • Look at the Message's _json.

In post-attrs, pre-this PR, the _json would be missing the footer. While this seems too niche of a problem to really solve (especially as the actual embeds were fine), this caused issues with extensions that overwrote _Context and subclasses of it, as many were using the pre-attrs way of handling the payload needed (using a Message object to ensure everything was right).

To fix this, we need to deepcopy the kwargs passed in to prevent other classes from accidentally modifying the input. Sadly, deepcopying every class's kwargs isn't possible as many will throw errors (especially anything involving HTTP or the gateway), so there's now a decorator to specify that any kwargs passed to a certain object should be deepcopied. You could also set the underlying magic variable that handles it too if desired.

This decorator was applied to embeds, which were the major pain point.

Checklist

  • I've ran pre-commit to format and lint the change(s) made.
  • I've checked to make sure the change(s) work on 3.8.6 and higher.
  • This fixes/solves an Issue.
    • (If existent):
  • I've made this pull request for/as: (check all that apply)
    • Documentation
    • Breaking change
    • New feature/enhancement (technically)
    • Bugfix

@EepyElvyra EepyElvyra enabled auto-merge (squash) June 13, 2022 15:42
@EepyElvyra EepyElvyra merged commit 93c7ef8 into interactions-py:unstable Jun 13, 2022
@AstreaTSS AstreaTSS deleted the cursed-embed-fix branch June 13, 2022 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants