Randomize and stagger posting intervals
This commit is contained in:
		
							parent
							
								
									e20a2b9f88
								
							
						
					
					
						commit
						2907cbc325
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -51,7 +51,9 @@ class MyClient(discord.Client):
 | 
			
		|||
                    await channel.send(gen_sentence())
 | 
			
		||||
                except:
 | 
			
		||||
                    pass
 | 
			
		||||
            await asyncio.sleep(3600)
 | 
			
		||||
                await asyncio.sleep((2700 + random.randrange(1800)) // min(max(len(self.guilds), 1), 100))
 | 
			
		||||
                if self.is_closed():
 | 
			
		||||
                    break
 | 
			
		||||
 | 
			
		||||
client = MyClient()
 | 
			
		||||
with open('token') as f:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue