mirror of
				https://github.com/TheLovinator1/discord-reminder-bot.git
				synced 2025-11-04 01:59:48 +01:00 
			
		
		
		
	Remove timeout handling from JobManagementView
This commit is contained in:
		@@ -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
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user