anonradio: dont do on ready actually, cant reload

This commit is contained in:
Cynthia Foxwell 2022-12-21 09:05:10 -07:00
parent 8d433ef6f7
commit 78b617f020

View file

@ -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",