fix: actually fix weird behavior with msgs and embeds #854
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About
This PR attempts to properly work around a very strange bug that made some extensions break.
Basically:
Messageand use the_jsonfor the embed when specifying the embeds.Message's_json.In post-attrs, pre-this PR, the
_jsonwould 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_Contextand subclasses of it, as many were using the pre-attrs way of handling the payload needed (using aMessageobject 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
pre-committo format and lint the change(s) made.3.8.6and higher.