From d96a2d8416f29f122650b198b8c0ea1a7b2a71e7 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Thu, 29 Jun 2023 00:51:36 +0300 Subject: [PATCH] some cleanup --- main.mjs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main.mjs b/main.mjs index 5f2725e..0eca207 100644 --- a/main.mjs +++ b/main.mjs @@ -13,8 +13,6 @@ const bot = new TelegramBot(config.telegramBotToken, { polling: true, }); -console.log(config); - bot.on("channel_post", async (msg) => { const link = extractMessageLink(msg); if (!link) return; @@ -41,6 +39,7 @@ bot.on("channel_post", async (msg) => { )(config)(); }); +// TODO: use option instead function extractMessageLink(msg) { const links = (msg.entities ?? []).filter(isLink); return links.length ? links[0] : null;