Skip to content

Commit

Permalink
Add on_timeout to Cocktail button
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreusada committed Sep 1, 2024
1 parent fff0c1e commit 2f6b54f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cocktail/cocktail.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ async def callback(self, interaction: discord.Interaction):
await interaction.response.send_message(message, ephemeral=True)
await self.view.message.edit(view=self.view, embed=embed)

async def on_timeout(self):
self.disabled = True
await self.view.message.edit(view=self.view)


class CocktailView(discord.ui.View):
def __init__(self, *, cog: Cocktail, cocktail: str, favourite: bool):
Expand All @@ -71,7 +75,7 @@ def __init__(self, bot: Red):
self.config.register_user(favourites=[])

__author__ = "Kreusada"
__version__ = "1.0.0"
__version__ = "1.0.1"

def format_help_for_context(self, ctx: commands.Context) -> str:
context = super().format_help_for_context(ctx)
Expand Down

0 comments on commit 2f6b54f

Please sign in to comment.