Remove timeout handling from JobManagementView

This commit is contained in:
2025-02-04 13:00:47 +01:00
parent 5261640189
commit b843364e1e

View File

@ -242,7 +242,7 @@ class JobManagementView(discord.ui.View):
guild: The guild this view is for. guild: The guild this view is for.
message: The message to manage. message: The message to manage.
""" """
super().__init__(timeout=30) super().__init__(timeout=None)
self.job: Job = job self.job: Job = job
self.scheduler: AsyncIOScheduler = scheduler self.scheduler: AsyncIOScheduler = scheduler
self.guild: discord.Guild = guild self.guild: discord.Guild = guild
@ -253,14 +253,6 @@ class JobManagementView(discord.ui.View):
logger.debug(f"JobManagementView created for job: {self.job.id}") logger.debug(f"JobManagementView created for job: {self.job.id}")
async def on_timeout(self) -> None:
"""Handle the view timeout."""
if self.message:
await self.message.edit(content="`/remind list` timed out.", embed=None, view=None)
else:
logger.debug(f"No message to edit for job: {self.job.id}")
self.stop()
async def on_error(self, interaction: discord.Interaction, error: Exception, item: discord.ui.Item) -> None: async def on_error(self, interaction: discord.Interaction, error: Exception, item: discord.ui.Item) -> None:
"""Handle errors that occur within the view. """Handle errors that occur within the view.
@ -423,11 +415,6 @@ class JobManagementView(discord.ui.View):
Returns: Returns:
bool: Whether the interaction is valid. bool: Whether the interaction is valid.
""" """
logger.info(f"Interaction check for job: {self.job.id}") logger.info(f"Checking interaction for job: {self.job.id}")
logger.debug(f"Timeout was {self.timeout} before interaction check.")
self.timeout = 30
logger.debug(f"Checking interaction for job: {self.job.id}")
self.update_buttons() self.update_buttons()
return True return True