From 0cc67e58eded2dd83841d6e4f62a4bc626348fb2 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 1 Aug 2021 03:29:43 -0400 Subject: [PATCH] Fallback to None message_id searches in View dispatch Not all persistent views have an associated message_id attached to them. Fix #7319 --- discord/ui/view.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/discord/ui/view.py b/discord/ui/view.py index ae0ba3b71..13510eeaf 100644 --- a/discord/ui/view.py +++ b/discord/ui/view.py @@ -507,7 +507,9 @@ class ViewStore: self.__verify_integrity() message_id: Optional[int] = interaction.message and interaction.message.id key = (component_type, message_id, custom_id) - value = self._views.get(key) + # Fallback to None message_id searches in case a persistent view + # was added without an associated message_id + value = self._views.get(key) or self._views.get((component_type, None, custom_id)) if value is None: return