From e364d83217ccae8a9862871bc6ef604fbe25cb4f Mon Sep 17 00:00:00 2001 From: Astrea49 <25420078+Astrea49@users.noreply.github.com> Date: Tue, 9 Aug 2022 22:08:09 -0400 Subject: [PATCH] feat: add __bool__ to embed --- naff/models/discord/embed.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/naff/models/discord/embed.py b/naff/models/discord/embed.py index 64a95387b..a0d8cdce7 100644 --- a/naff/models/discord/embed.py +++ b/naff/models/discord/embed.py @@ -266,6 +266,20 @@ def __len__(self) -> int: total += sum(map(len, self.fields)) return total + def __bool__(self) -> bool: + return any( + ( + self.title, + self.description, + self.fields, + self.author, + self.thumbnail, + self.footer, + self.image, + self.video, + ) + ) + def set_author( self, name: str,