waengine 2.0.0 → 2.2.4

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.0.0",
3
+ "version": "2.2.4",
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
@@ -262,6 +262,11 @@ export class WhatsAppClient {
262
262
  // ===== CONNECTION METHODS =====
263
263
 
264
264
  async connect() {
265
+ // ===== SESSION MENU - AUTOMATISCH FÜR JEDEN USER! =====
266
+ const { showSessionMenuIfNeeded } = await import('./console-logger.js');
267
+ await showSessionMenuIfNeeded();
268
+ // ===== ENDE SESSION MENU =====
269
+
265
270
  if (this.socket && this.isConnected) {
266
271
  return this.socket;
267
272
  }
@@ -274,4 +274,32 @@ export class ConsoleLogger {
274
274
  }
275
275
 
276
276
  // Export für einfache Nutzung
277
- export const logger = new ConsoleLogger();
277
+ export const logger = new ConsoleLogger();
278
+
279
+
280
+ // ===== SESSION MENU INTEGRATION - NEU! =====
281
+ import { SessionMenu } from './session-menu.js';
282
+
283
+ // Globale Variable um zu tracken ob das Menü bereits gezeigt wurde
284
+ let sessionMenuShown = false;
285
+
286
+ export async function showSessionMenuIfNeeded() {
287
+ if (sessionMenuShown) return null;
288
+ sessionMenuShown = true;
289
+
290
+ const menu = new SessionMenu();
291
+
292
+ // Wenn keine Sessions existieren, zeige das Menü automatisch
293
+ if (menu.sessions.length === 0) {
294
+ console.log('\n🎉 Willkommen bei WAEngine!\n');
295
+ console.log('📱 Keine Sessions gefunden. Lass uns eine erstellen...\n');
296
+
297
+ await menu.start();
298
+ return menu.getActiveSessions();
299
+ }
300
+
301
+ return null;
302
+ }
303
+
304
+ // Export für manuelle Nutzung
305
+ export { SessionMenu };
@@ -440,6 +440,10 @@ export class SessionMenu {
440
440
  break;
441
441
  case '5':
442
442
  running = false;
443
+ this.rl.close();
444
+ this.clearScreen();
445
+ console.log(c.cyan('👋 Auf Wiedersehen!\n'));
446
+ process.exit(0); // Beende das Programm komplett
443
447
  break;
444
448
  default:
445
449
  console.log(c.red('\n❌ Ungültige Auswahl!'));