anonradio: dont do on ready actually, cant reload
This commit is contained in:
		
							parent
							
								
									8d433ef6f7
								
							
						
					
					
						commit
						78b617f020
					
				
					 1 changed files with 2 additions and 4 deletions
				
			
		| 
						 | 
					@ -105,7 +105,7 @@ async function updateNowPlaying() {
 | 
				
			||||||
  const timestamp = `<t:${Math.floor(now/1000)}:T>`;
 | 
					  const timestamp = `<t:${Math.floor(now/1000)}:T>`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const content = `${timestamp}\n${title}\n${subtitle}\n${openmicTime}`.trim();
 | 
					  const content = `${timestamp}\n${title}\n${subtitle}\n${openmicTime}`.trim();
 | 
				
			||||||
  const thread = hf.bot.guilds.get(GUILD_ID).threads.get(THREAD_ID);
 | 
					  const thread = hf.bot.guilds.get(GUILD_ID)?.threads.get(THREAD_ID);
 | 
				
			||||||
  if (thread) {
 | 
					  if (thread) {
 | 
				
			||||||
    const msg = await thread.getMessage(MESSAGE_ID);
 | 
					    const msg = await thread.getMessage(MESSAGE_ID);
 | 
				
			||||||
    if (msg.content !== content) {
 | 
					    if (msg.content !== content) {
 | 
				
			||||||
| 
						 | 
					@ -115,9 +115,7 @@ async function updateNowPlaying() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  hf.__anonradio_timeout = setTimeout(updateNowPlaying, 2000);
 | 
					  hf.__anonradio_timeout = setTimeout(updateNowPlaying, 2000);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
hf.bot.once("ready", () => {
 | 
					updateNowPlaying();
 | 
				
			||||||
  updateNowPlaying();
 | 
					 | 
				
			||||||
});
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*hf.timer.add(
 | 
					/*hf.timer.add(
 | 
				
			||||||
  "anonradio",
 | 
					  "anonradio",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue