statuses
This commit is contained in:
		
							parent
							
								
									6501125b26
								
							
						
					
					
						commit
						d0ee15b4e9
					
				
					 1 changed files with 21 additions and 0 deletions
				
			
		
							
								
								
									
										21
									
								
								src/modules/status.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								src/modules/status.js
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,21 @@
 | 
			
		|||
const statuses = [
 | 
			
		||||
  {type: 0, text: "on %servers% servers"},
 | 
			
		||||
  {type: 0, text: "with %users% users"},
 | 
			
		||||
  {type: 0, text: "with %commands% commands"},
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
function setStatus() {
 | 
			
		||||
  const status = statuses[Math.floor(Math.random() * statuses.length)];
 | 
			
		||||
  const text = status.text
 | 
			
		||||
    .replace("%servers%", hf.bot.guilds.size)
 | 
			
		||||
    .replace("%users%", hf.bot.users.size)
 | 
			
		||||
    .replace("%commands%", hf.commands.size);
 | 
			
		||||
 | 
			
		||||
  hf.bot.editStatus("online", {
 | 
			
		||||
    type: status.type,
 | 
			
		||||
    name: `${text} | ${hf.config.prefix}help`,
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
hf.bot.once("ready", setStatus);
 | 
			
		||||
hf.timer.add("status", setStatus, 300000);
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue