From 26457b6d5036b743d4e56fc4fb62fa9d7d500275 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 15 Mar 2022 10:29:58 -0400 Subject: [PATCH] Remove automatic defer behaviour from View and Modal This doesn't make as much sense anymore now that InteractionResponse.edit_message exists. --- discord/ui/modal.py | 2 -- discord/ui/view.py | 2 -- 2 files changed, 4 deletions(-) diff --git a/discord/ui/modal.py b/discord/ui/modal.py index f9656bad9..a9b6ea343 100644 --- a/discord/ui/modal.py +++ b/discord/ui/modal.py @@ -192,8 +192,6 @@ class Modal(View): return await self.on_submit(interaction) - if not interaction.response._responded: - await interaction.response.defer() except Exception as e: return await self.on_error(e, interaction) else: diff --git a/discord/ui/view.py b/discord/ui/view.py index 83a179c9a..5d9bbe38a 100644 --- a/discord/ui/view.py +++ b/discord/ui/view.py @@ -366,8 +366,6 @@ class View: return await item.callback(interaction) - if not interaction.response._responded: - await interaction.response.defer() except Exception as e: return await self.on_error(e, item, interaction)