diff options
| author | Nadir Chowdhury <[email protected]> | 2021-06-30 01:03:50 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-06-29 20:03:50 -0400 |
| commit | abac04b759a8c9191935880de5cd686e5c146783 (patch) | |
| tree | 4b555a7dd4070cc3f4b99bf27edd3756f9720cc1 /discord/ui/button.py | |
| parent | add persistent view in on_ready to avoid loop issues (diff) | |
| download | discord.py-abac04b759a8c9191935880de5cd686e5c146783.tar.xz discord.py-abac04b759a8c9191935880de5cd686e5c146783.zip | |
Fix link buttons not being regarded as persistent
Diffstat (limited to 'discord/ui/button.py')
| -rw-r--r-- | discord/ui/button.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/discord/ui/button.py b/discord/ui/button.py index e5dc8a96..0f6ab9ee 100644 --- a/discord/ui/button.py +++ b/discord/ui/button.py @@ -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 |