Skip to content

Commit

Permalink
fix: handle ephemeral messages in disable_on_timeout (#2297)
Browse files Browse the repository at this point in the history
* attempt fix

* style(pre-commit): auto fixes from pre-commit.com hooks

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
OmLanke and pre-commit-ci[bot] authored Dec 22, 2023
1 parent 40d2b00 commit 16c696c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion discord/ui/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,12 @@ async def on_timeout(self) -> None:
"""
if self.disable_on_timeout:
self.disable_all_items()
message = self._message or self.parent

if not self._message or self._message.flags.ephemeral:
message = self.parent
else:
message = self.message

if message:
m = await message.edit(view=self)
if m:
Expand Down

0 comments on commit 16c696c

Please sign in to comment.