From 55ffddf4d88db3b0ee5dac62d410b57d46e3312d Mon Sep 17 00:00:00 2001 From: Emre Terzioglu <50607143+EmreTech@users.noreply.github.com> Date: Sun, 30 Jan 2022 10:57:00 -0800 Subject: [PATCH] Remove MISSING check from embed, embeds, view This removes the check if embed, embeds, and view are equal to MISSING and instead replaces it with if it is None. --- discord/interactions.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/discord/interactions.py b/discord/interactions.py index 239d04ac89..cb2273228f 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -502,9 +502,9 @@ async def send_message( self, content: Optional[Any] = None, *, - embed: Embed = MISSING, - embeds: List[Embed] = MISSING, - view: View = MISSING, + embed: Embed = None, + embeds: List[Embed] = None, + view: View = None, tts: bool = False, ephemeral: bool = False, allowed_mentions: AllowedMentions = None, @@ -563,10 +563,10 @@ async def send_message( 'tts': tts, } - if embed is not MISSING and embeds is not MISSING: + if embed is not None and embeds is not None: raise TypeError('cannot mix embed and embeds keyword arguments') - if embed is not MISSING and embed is not None: + if embed is not None: embeds = [embed] if embeds: @@ -580,7 +580,7 @@ async def send_message( if ephemeral: payload['flags'] = 64 - if view is not MISSING and view is not None: + if view is not None: payload['components'] = view.to_components() state = self._parent._state @@ -624,7 +624,7 @@ async def send_message( for file in files: file.close() - if view is not MISSING and view is not None: + if view is not None: if ephemeral and view.timeout is None: view.timeout = 15 * 60.0