Fix link buttons not being regarded as persistent

This commit is contained in:
Nadir Chowdhury
2021-06-29 20:03:50 -04:00
committed by GitHub
parent 7d0bd7ed20
commit abac04b759
+5
View File
@@ -217,6 +217,11 @@ class Button(Item[V]):
def is_dispatchable(self) -> bool:
return self.custom_id is not None
def is_persistent(self) -> bool:
if self.style is ButtonStyle.link:
return self.url is not None
return super().is_persistent()
def refresh_component(self, button: ButtonComponent) -> None:
self._underlying = button