def canDisplay(self, server): lastTime = int(self.settings.getServerStat(server, "LastPicture", 0)) threshold = int( self.settings.getServerStat(server, "PictureTherehold", 0)) if not GetImage.canDisplay(lastTime, threshold): return False self.settings.getServerStat(server, "LastPicture", int(time.time())) return True
def canDisplay(self, server): # Check if we can display images lastTime = int(self.settings.getServerStat(server, "LastPicture")) threshold = int(self.settings.getServerStat(server, "PictureThreshold")) if not GetImage.canDisplay( lastTime, threshold ): # await channel.send('Too many images at once - please wait a few seconds.') return False # If we made it here - set the LastPicture method self.settings.setServerStat(server, "LastPicture", int(time.time())) return True