waengine 2.4.4 → 2.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waengine",
3
- "version": "2.4.4",
3
+ "version": "2.4.6",
4
4
  "description": "🚀 WAEngine - The most powerful WhatsApp Bot Library with 860+ Working Features, Complete Baileys Integration & Production-Ready Stability",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/client.js CHANGED
@@ -28,6 +28,10 @@ export class WhatsAppClient {
28
28
  silent: options.silent || false
29
29
  });
30
30
 
31
+ // CONSOLE MODE SYSTEM - NEUE API!
32
+ this.consoleVerbose = true; // Standard: Alle Details
33
+ this.consoleSilent = false; // Standard: Nicht silent
34
+
31
35
  // ERROR HANDLER SYSTEM - IMMER AKTIV MIT DEINER EMAIL!
32
36
  this.errorHandler = new ErrorHandler({
33
37
  supportEmail: "Liaia@outlook.de", // DEINE EMAIL - IMMER ANGEZEIGT
@@ -190,6 +194,23 @@ export class WhatsAppClient {
190
194
  }
191
195
  };
192
196
 
197
+ // Console Mode API - NEUE FUNKTION!
198
+ this.info = {
199
+ Console: (enabled = true) => {
200
+ this.consoleVerbose = enabled;
201
+ console.log(`📊 Console Info Mode: ${enabled ? 'VERBOSE (Alle Details)' : 'NORMAL (Nur wichtige Infos)'}`);
202
+ return this;
203
+ }
204
+ };
205
+
206
+ this.silent = {
207
+ Console: (enabled = true) => {
208
+ this.consoleSilent = enabled;
209
+ console.log(`🔇 Console Silent Mode: ${enabled ? 'AKTIVIERT (Nur gesendete Messages)' : 'DEAKTIVIERT (Normal)'}`);
210
+ return this;
211
+ }
212
+ };
213
+
193
214
  // ===== GLOBAL VISUAL TYPING/RECORDING API - NEU! =====
194
215
  // Set API für Dauer-Einstellungen
195
216
  this.set = {
@@ -984,19 +1005,25 @@ export class WhatsAppClient {
984
1005
  setupEventHandlers() {
985
1006
  // Messages - Saubere Message-Erkennung ohne Debug-Spam
986
1007
  this.socket.ev.on("messages.upsert", ({ messages, type }) => {
987
- // DEBUG: Zeige alle Message-Types
988
- console.log(`📥 Message Event - Type: ${type}, Count: ${messages.length}`);
1008
+ // DEBUG: Zeige alle Message-Types (nur im Verbose Mode)
1009
+ if (this.consoleVerbose && !this.consoleSilent) {
1010
+ console.log(`📥 Message Event - Type: ${type}, Count: ${messages.length}`);
1011
+ }
989
1012
 
990
1013
  // WICHTIG: Alte History-Messages ignorieren (prepend)
991
1014
  if (type === "prepend") {
992
- console.log(`⏭️ Ignoriere ${messages.length} History Messages (prepend)`);
1015
+ if (this.consoleVerbose && !this.consoleSilent) {
1016
+ console.log(`⏭️ Ignoriere ${messages.length} History Messages (prepend)`);
1017
+ }
993
1018
  return;
994
1019
  }
995
1020
 
996
1021
  messages.forEach((msg) => {
997
1022
  // KRITISCHE VALIDIERUNG: Prüfe ob Message-Key existiert
998
1023
  if (!msg.key || !msg.key.remoteJid || !msg.key.id) {
999
- console.log(`⚠️ Ungültige Message ohne Key - ignoriert`);
1024
+ if (this.consoleVerbose && !this.consoleSilent) {
1025
+ console.log(`⚠️ Ungültige Message ohne Key - ignoriert`);
1026
+ }
1000
1027
  return;
1001
1028
  }
1002
1029
 
@@ -1060,7 +1087,21 @@ export class WhatsAppClient {
1060
1087
 
1061
1088
  // Nur bei echten Nachrichten loggen
1062
1089
  if (messageData.text || messageData.type !== 'unknown') {
1063
- console.log(`📨 ${messageData.type}: "${messageData.text || '[Media]'}" von ${messageData.from}`);
1090
+ // Silent Mode: Nur gesendete Messages
1091
+ if (this.consoleSilent) {
1092
+ // Zeige nichts beim Empfangen
1093
+ }
1094
+ // Normal Mode: Nur wichtige Infos
1095
+ else if (!this.consoleVerbose) {
1096
+ // Zeige nur Text, kein "von"
1097
+ if (messageData.text) {
1098
+ console.log(`📨 ${messageData.type}: "${messageData.text}"`);
1099
+ }
1100
+ }
1101
+ // Verbose Mode: Alle Details
1102
+ else {
1103
+ console.log(`📨 ${messageData.type}: "${messageData.text || '[Media]'}" von ${messageData.from}`);
1104
+ }
1064
1105
  }
1065
1106
 
1066
1107
  const messageObj = new Message(this, messageData);
@@ -1072,7 +1113,11 @@ export class WhatsAppClient {
1072
1113
  const commandData = this.prefixManager.parseCommand(messageData.text, messageData.from);
1073
1114
 
1074
1115
  if (commandData) {
1075
- console.log(`⚡ Command in ${messageData.from}: ${commandData.prefix}${commandData.command}`);
1116
+ // Silent Mode: Nichts zeigen
1117
+ if (!this.consoleSilent) {
1118
+ // Normal & Verbose Mode: Command anzeigen
1119
+ console.log(`⚡ Command in ${messageData.from}: ${commandData.prefix}${commandData.command}`);
1120
+ }
1076
1121
 
1077
1122
  messageObj.isCommand = true;
1078
1123
  messageObj.command = commandData.command;
package/src/message.js CHANGED
@@ -72,6 +72,18 @@ export class Message {
72
72
  // ===== GLOBAL VISUAL TYPING/RECORDING - AUTOMATISCH! =====
73
73
  await this.client._executeGlobalVisual(this.from);
74
74
 
75
+ // Console Logging basierend auf Mode
76
+ if (!this.client.consoleSilent) {
77
+ if (this.client.consoleVerbose) {
78
+ console.log(`📤 Sende an ${this.from}: "${text}"`);
79
+ } else {
80
+ console.log(`📤 Gesendet: "${text}"`);
81
+ }
82
+ } else {
83
+ // Silent Mode: Nur kurze Info
84
+ console.log(`📤 "${text}"`);
85
+ }
86
+
75
87
  // Hidetag Feature - DEINE COOLE API!
76
88
  if (options.hidetag) {
77
89
  if (!this.isGroup) {