mirror of
https://github.com/TheNetsky/Microsoft-Rewards-Script.git
synced 2026-01-11 10:56:17 +00:00
added webhooklogexcludefunc (#240)
This commit is contained in:
@@ -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.searchDelay | Minimum and maximum time in miliseconds between search queries | `min: 1min` `max: 2min` |
|
||||||
| searchSettings.retryMobileSearchAmount | Keep retrying mobile searches for specified amount | `3` |
|
| searchSettings.retryMobileSearchAmount | Keep retrying mobile searches for specified amount | `3` |
|
||||||
| logExcludeFunc | Functions to exclude out of the logs and webhooks | `SEARCH-CLOSE-TABS` |
|
| 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.enabled | Enable or disable your set webhook | `false` |
|
||||||
| webhook.url | Your Discord webhook URL | `null` |
|
| 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) |
|
| cronStartTime | Scheduled script run-time, *only available for docker implementation* | `0 5,11 * * *` (5:00 am, 11:00 am daily) |
|
||||||
|
|||||||
@@ -33,6 +33,9 @@
|
|||||||
"logExcludeFunc": [
|
"logExcludeFunc": [
|
||||||
"SEARCH-CLOSE-TABS"
|
"SEARCH-CLOSE-TABS"
|
||||||
],
|
],
|
||||||
|
"webhooklogExcludeFunc": [
|
||||||
|
"SEARCH-CLOSE-TABS"
|
||||||
|
],
|
||||||
"webhook": {
|
"webhook": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"url": ""
|
"url": ""
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export interface Config {
|
|||||||
searchSettings: SearchSettings;
|
searchSettings: SearchSettings;
|
||||||
webhook: Webhook;
|
webhook: Webhook;
|
||||||
logExcludeFunc: string[];
|
logExcludeFunc: string[];
|
||||||
|
webhooklogExcludeFunc: string[];
|
||||||
saveFingerprint: ConfigSaveFingerprint;
|
saveFingerprint: ConfigSaveFingerprint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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}`
|
const cleanStr = `[${currentTime}] [PID: ${process.pid}] [${type.toUpperCase()}] ${platformText} [${title}] ${message}`
|
||||||
|
|
||||||
// Send the clean string to the Webhook
|
// 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
|
// Formatted string with chalk for terminal logging
|
||||||
const str = `[${currentTime}] [PID: ${process.pid}] [${type.toUpperCase()}] ${chalkedPlatform} [${title}] ${message}`
|
const str = `[${currentTime}] [PID: ${process.pid}] [${type.toUpperCase()}] ${chalkedPlatform} [${title}] ${message}`
|
||||||
|
|||||||
Reference in New Issue
Block a user