From 69f6abd6adf6e11c5cab62a166ab24c60cd0af5b Mon Sep 17 00:00:00 2001 From: David Stephens Date: Wed, 8 Nov 2023 16:29:47 +0000 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20attempt=20to=20send=20notificat?= =?UTF-8?q?ion=20messages=20with=20empty=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- botto/views/testflight_form.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/botto/views/testflight_form.py b/botto/views/testflight_form.py index 7997eb4..4739192 100644 --- a/botto/views/testflight_form.py +++ b/botto/views/testflight_form.py @@ -96,13 +96,14 @@ async def on_submit(self, interaction: discord.Interaction): await interaction.response.send_message( f"Thanks for registering with {self.email.value}. You will be notified when your request has been approved." ) - try: - await asyncio.wait(message_sends) - except discord.DiscordException: - await interaction.followup.send( - f"There was an error submitting your testing requests 😢. Please try again" - ) - raise + if len(message_sends) > 0: + try: + await asyncio.wait(message_sends) + except discord.DiscordException: + await interaction.followup.send( + f"There was an error submitting your testing requests 😢. Please try again" + ) + raise async def on_error(self, interaction: discord.Interaction, error: Exception): log.error(