From cd821f93c002f51f1d690fc0a40f4d17e3d62564 Mon Sep 17 00:00:00 2001 From: Nils Date: Sat, 13 Sep 2025 11:08:57 +0200 Subject: [PATCH] get adverts --- meshcore-bot.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/meshcore-bot.js b/meshcore-bot.js index 24feb5c..65c60b0 100755 --- a/meshcore-bot.js +++ b/meshcore-bot.js @@ -211,6 +211,15 @@ async function onChannelMessageReceived(message) { } } +// listen for adverts +connection.on(Constants.PushCodes.Advert, async (advert) => { + try { + console.log(`[${getTimestamp()}] Advert: ${Buffer.from(advert.publicKey).toString('hex')}`); + } catch(e) { + console.error("Advert could not be retrieved", e); + } +}); + async function getRepeaterTelemetry(publicKeyPrefix, repeaterPassword) { console.log("Fetching repeater status and telemetry..."); try {