From c64feb2fe525d16c0c10bda9b8d842c282b30858 Mon Sep 17 00:00:00 2001 From: Ladd Hoffman Date: Wed, 24 Apr 2024 12:37:26 -0500 Subject: [PATCH] bot logging --- backend/src/matrix.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/matrix.js b/backend/src/matrix.js index 2887300..5539e29 100644 --- a/backend/src/matrix.js +++ b/backend/src/matrix.js @@ -20,7 +20,8 @@ const cryptoProvider = new RustSdkCryptoStorageProvider(BOT_CRYPTO_STORAGE_PATH) let client; let joinedRooms; const processOutboundQueue = async ({ text }) => { - joinedRooms.forEach(async (roomId) => { + console.log('broadcasting', { text }); + await Promise.each(joinedRooms, async (roomId) => { await client.sendText(roomId, text); }); }; @@ -54,6 +55,7 @@ const start = async () => { if (!body?.startsWith('!hello')) return; // Now that we've passed all the checks, we can actually act upon the command + console.log(`!hello roomId ${roomId}`); await client.replyNotice(roomId, event, 'Hello world!'); }