Remove duplicate message from showing
This commit is contained in:
parent
79f7d4763a
commit
d1802a291d
7
main.js
7
main.js
|
@ -39,12 +39,7 @@ async function immediatePriceCheckAndAnnounce() {
|
||||||
const solanaData = readSolanaData();
|
const solanaData = readSolanaData();
|
||||||
const lastKnownPrice = solanaData ? solanaData.price : null;
|
const lastKnownPrice = solanaData ? solanaData.price : null;
|
||||||
const currentPrice = await fetchSolanaPrice();
|
const currentPrice = await fetchSolanaPrice();
|
||||||
|
|
||||||
if (currentPrice && lastKnownPrice !== null && (parseFloat(currentPrice) - lastKnownPrice >= 2.5)) {
|
|
||||||
const announcementsChannel = await client.channels.fetch(announcementsChannelId);
|
|
||||||
await announcementsChannel.send(`@everyone Significant Solana price increase detected! Previous recorded price: $${lastKnownPrice}. Current price: $${currentPrice}.`);
|
|
||||||
}
|
|
||||||
|
|
||||||
checkPriceContinuously();
|
checkPriceContinuously();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue