Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

feat: add __bool__ to Embed #592

Merged
merged 1 commit into from
Aug 10, 2022
Merged

Conversation

AstreaTSS
Copy link
Contributor

What type of pull request is this?

  • Non-breaking code change
  • Breaking code change
  • Documentation change/addition
  • Tests change

Description

This PR simply adds __bool__ to embed. This allows values like image to affect the output.
This also allows embeds with no "text" to be sent, as the embed would otherwise be evaluated as False during the sanity check instead.

Why? Guessing __len__ messed things up.

Changes

  • I mean, literally what the title says.
    • From really basic experimentation, these fields, if present, allow the embed to be sent without Discord throwing an error. Any field that resulted in an error was left out.
    • Of course, I couldn't test video, but it's a good guess on my part.

Checklist

  • I've formatted my code with Black
  • I've ensured my code works on Python 3.10.x
  • I've tested my code

@LordOfPolls LordOfPolls merged commit 1f7e1d2 into NAFTeam:dev Aug 10, 2022
@AstreaTSS AstreaTSS deleted the embed-bool branch August 11, 2022 23:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants