Skip to content

fix: properly parse image from dict for embeds #1455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 21, 2023

Conversation

AstreaTSS
Copy link
Member

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

Description

Ever since the change to make Embed have images instead of image, it seems like there was a bug where embeds from messages (or from a passed-in dictionary in general) were not processed properly by Embed and so were missing from the resulting object. This PR fixes that.

Changes

  • Convert "image" field in a dict to "images" if detected when processing the dict for Embed.

Related Issues

Test Scenarios

  • Send message on Discord with an embed with an image.
  • Fetch that message, look at the embed, and observe the lack of an image in the resulting object.

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x

Checklist

  • I've run the pre-commit code linter over all edited files
  • I've tested my changes on supported Python versions
  • I've added tests for my code, if applicable
  • I've updated / added documentation, where applicable

@LordOfPolls LordOfPolls merged commit 1bd1100 into interactions-py:unstable Jun 21, 2023
@AstreaTSS AstreaTSS deleted the image-embed-fix branch June 21, 2023 15:56
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