From 82a896e83f2884b8d43ca99a2736b5958cee7af4 Mon Sep 17 00:00:00 2001 From: 1OSA <39868106+1OSA@users.noreply.github.com> Date: Fri, 21 Feb 2025 01:21:46 +0300 Subject: [PATCH] added webhooklogexcludefunc (#240) --- README.md | 3 ++- src/config.json | 5 ++++- src/interface/Config.ts | 1 + src/util/Logger.ts | 6 ++++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a932a56..203d2f3 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,7 @@ A basic docker `compose.yaml` is provided. Follow these steps to configure and r | searchSettings.searchDelay | Minimum and maximum time in miliseconds between search queries | `min: 1min` `max: 2min` | | searchSettings.retryMobileSearchAmount | Keep retrying mobile searches for specified amount | `3` | | logExcludeFunc | Functions to exclude out of the logs and webhooks | `SEARCH-CLOSE-TABS` | +| webhooklogExcludeFunc | Functions to exclude out of the webhooks log | `SEARCH-CLOSE-TABS` | | webhook.enabled | Enable or disable your set webhook | `false` | | webhook.url | Your Discord webhook URL | `null` | | cronStartTime | Scheduled script run-time, *only available for docker implementation* | `0 5,11 * * *` (5:00 am, 11:00 am daily) | @@ -112,4 +113,4 @@ A basic docker `compose.yaml` is provided. Follow these steps to configure and r ## Disclaimer ## Your account may be at risk of getting banned or suspended using this script, you've been warned!
-Use this script at your own risk! \ No newline at end of file +Use this script at your own risk! diff --git a/src/config.json b/src/config.json index 9fc84bc..89b7f56 100644 --- a/src/config.json +++ b/src/config.json @@ -33,8 +33,11 @@ "logExcludeFunc": [ "SEARCH-CLOSE-TABS" ], + "webhooklogExcludeFunc": [ + "SEARCH-CLOSE-TABS" + ], "webhook": { "enabled": false, "url": "" } -} \ No newline at end of file +} diff --git a/src/interface/Config.ts b/src/interface/Config.ts index b97d3e1..db9e9a5 100644 --- a/src/interface/Config.ts +++ b/src/interface/Config.ts @@ -11,6 +11,7 @@ export interface Config { searchSettings: SearchSettings; webhook: Webhook; logExcludeFunc: string[]; + webhooklogExcludeFunc: string[]; saveFingerprint: ConfigSaveFingerprint; } diff --git a/src/util/Logger.ts b/src/util/Logger.ts index 83ed599..b0350bd 100644 --- a/src/util/Logger.ts +++ b/src/util/Logger.ts @@ -19,7 +19,9 @@ export function log(isMobile: boolean | 'main', title: string, message: string, const cleanStr = `[${currentTime}] [PID: ${process.pid}] [${type.toUpperCase()}] ${platformText} [${title}] ${message}` // Send the clean string to the Webhook - Webhook(configData, cleanStr) + if (!configData.webhooklogExcludeFunc.some(x => x.toLowerCase() === title.toLowerCase())) { + Webhook(configData, cleanStr) + } // Formatted string with chalk for terminal logging const str = `[${currentTime}] [PID: ${process.pid}] [${type.toUpperCase()}] ${chalkedPlatform} [${title}] ${message}` @@ -40,4 +42,4 @@ export function log(isMobile: boolean | 'main', title: string, message: string, applyChalk ? console.log(applyChalk(str)) : console.log(str) break } -} \ No newline at end of file +}