anonradio: try/catch
This commit is contained in:
parent
543192bb28
commit
955ca1c739
1 changed files with 10 additions and 6 deletions
|
@ -116,6 +116,7 @@ async function updateNowPlaying() {
|
||||||
const content = `${title}\n${subtitle}\n${openmicTime}`.trim();
|
const content = `${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) {
|
||||||
|
try {
|
||||||
const msg = await thread.getMessage(MESSAGE_ID);
|
const msg = await thread.getMessage(MESSAGE_ID);
|
||||||
const oldContent = msg.content.replace(/<t:\d+:T>\n/, "").trim();
|
const oldContent = msg.content.replace(/<t:\d+:T>\n/, "").trim();
|
||||||
if (oldContent !== content) {
|
if (oldContent !== content) {
|
||||||
|
@ -123,6 +124,9 @@ async function updateNowPlaying() {
|
||||||
content: timestamp + "\n" + content,
|
content: timestamp + "\n" + content,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
//
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hf.__anonradio_timeout = setTimeout(updateNowPlaying, 2000);
|
hf.__anonradio_timeout = setTimeout(updateNowPlaying, 2000);
|
||||||
|
|
Loading…
Reference in a new issue