anonradio: fix edit spam from timestamp try 2
This commit is contained in:
parent
99c89bd7e7
commit
dd8fc1a7f4
|
@ -108,7 +108,7 @@ async function updateNowPlaying() {
|
||||||
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);
|
||||||
const oldContent = msg.content.replace(/<t:\d+:T>\n/,"");
|
const oldContent = msg.content.replace(/<t:\d+:T>/,"").trim();
|
||||||
if (oldContent !== content) {
|
if (oldContent !== content) {
|
||||||
await thread.editMessage(MESSAGE_ID, {content: timestamp + "\n" + content});
|
await thread.editMessage(MESSAGE_ID, {content: timestamp + "\n" + content});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue