waengine 1.0.2 → 1.0.5
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 +2 -1
- package/src/client.js +124 -24
- package/src/qr.js +132 -23
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "waengine",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "🚀 WAEngine - The most powerful WhatsApp Bot Library with Multi-Device Support & EasyBot API",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"@whiskeysockets/baileys": "^7.0.0-rc.9",
|
|
50
50
|
"pino": "^8.0.0",
|
|
51
51
|
"playwright": "^1.58.1",
|
|
52
|
+
"qrcode": "^1.5.4",
|
|
52
53
|
"qrcode-terminal": "^0.12.0"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
package/src/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { makeWASocket, useMultiFileAuthState, DisconnectReason, fetchLatestBaileysVersion } from "@whiskeysockets/baileys";
|
|
1
|
+
import { makeWASocket, useMultiFileAuthState, DisconnectReason, fetchLatestBaileysVersion, isJidBroadcast } from "@whiskeysockets/baileys";
|
|
2
2
|
import pino from "pino";
|
|
3
3
|
import { generateQRCode, closeBrowser } from "./qr.js";
|
|
4
4
|
import { Message } from "./message.js";
|
|
@@ -48,26 +48,46 @@ export class WhatsAppClient {
|
|
|
48
48
|
this.socket = makeWASocket({
|
|
49
49
|
version,
|
|
50
50
|
auth: state,
|
|
51
|
-
printQRInTerminal: this.options.printQR,
|
|
52
51
|
logger: pino({ level: this.options.logLevel }),
|
|
53
52
|
browser: this.options.browser,
|
|
54
53
|
generateHighQualityLinkPreview: true,
|
|
55
|
-
syncFullHistory:
|
|
56
|
-
markOnlineOnConnect: true
|
|
54
|
+
syncFullHistory: true, // Wichtig für Message-Empfang
|
|
55
|
+
markOnlineOnConnect: true,
|
|
56
|
+
getMessage: async (key) => {
|
|
57
|
+
// Wichtig für Message-Handling
|
|
58
|
+
return { conversation: "Message not found" };
|
|
59
|
+
},
|
|
60
|
+
shouldIgnoreJid: jid => isJidBroadcast(jid),
|
|
61
|
+
// Bessere Message-Synchronisation
|
|
62
|
+
emitOwnEvents: true,
|
|
63
|
+
fireInitQueries: true,
|
|
64
|
+
shouldSyncHistoryMessage: msg => {
|
|
65
|
+
return !!msg.message && !msg.key.fromMe;
|
|
66
|
+
}
|
|
57
67
|
});
|
|
58
68
|
} catch (versionError) {
|
|
59
69
|
this.socket = makeWASocket({
|
|
60
70
|
auth: state,
|
|
61
|
-
printQRInTerminal: this.options.printQR,
|
|
62
71
|
logger: pino({ level: this.options.logLevel }),
|
|
63
72
|
browser: this.options.browser,
|
|
64
73
|
generateHighQualityLinkPreview: true,
|
|
65
|
-
syncFullHistory:
|
|
66
|
-
markOnlineOnConnect: true
|
|
74
|
+
syncFullHistory: true, // Wichtig für Message-Empfang
|
|
75
|
+
markOnlineOnConnect: true,
|
|
76
|
+
getMessage: async (key) => {
|
|
77
|
+
// Wichtig für Message-Handling
|
|
78
|
+
return { conversation: "Message not found" };
|
|
79
|
+
},
|
|
80
|
+
shouldIgnoreJid: jid => isJidBroadcast(jid),
|
|
81
|
+
// Bessere Message-Synchronisation
|
|
82
|
+
emitOwnEvents: true,
|
|
83
|
+
fireInitQueries: true,
|
|
84
|
+
shouldSyncHistoryMessage: msg => {
|
|
85
|
+
return !!msg.message && !msg.key.fromMe;
|
|
86
|
+
}
|
|
67
87
|
});
|
|
68
88
|
}
|
|
69
89
|
|
|
70
|
-
console.log("🔌
|
|
90
|
+
console.log("🔌 WAEngine startet...");
|
|
71
91
|
|
|
72
92
|
// QR-Code Browser nur öffnen wenn nicht eingeloggt
|
|
73
93
|
if (!this.options.printQR && !isLoggedIn) {
|
|
@@ -75,9 +95,28 @@ export class WhatsAppClient {
|
|
|
75
95
|
}
|
|
76
96
|
|
|
77
97
|
return new Promise((resolve, reject) => {
|
|
98
|
+
// Event-Handler SOFORT registrieren, nicht erst bei "open"
|
|
99
|
+
this.setupEventHandlers();
|
|
100
|
+
|
|
78
101
|
this.socket.ev.on("connection.update", async ({ connection, lastDisconnect, qr }) => {
|
|
79
|
-
if (qr
|
|
80
|
-
|
|
102
|
+
if (qr) {
|
|
103
|
+
if (this.options.printQR) {
|
|
104
|
+
// Terminal QR
|
|
105
|
+
console.log("\n📱 QR-CODE IM TERMINAL:");
|
|
106
|
+
console.log("─".repeat(50));
|
|
107
|
+
const qrcode = await import("qrcode-terminal");
|
|
108
|
+
qrcode.default.generate(qr, { small: true });
|
|
109
|
+
console.log("─".repeat(50));
|
|
110
|
+
console.log("📲 Scanne den QR-Code mit WhatsApp!");
|
|
111
|
+
} else {
|
|
112
|
+
// Browser QR
|
|
113
|
+
console.log("📱 QR-Code im Browser angezeigt");
|
|
114
|
+
await generateQRCode(qr);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (connection === "connecting") {
|
|
119
|
+
console.log("🔄 Verbinde...");
|
|
81
120
|
}
|
|
82
121
|
|
|
83
122
|
if (connection === "close") {
|
|
@@ -85,10 +124,12 @@ export class WhatsAppClient {
|
|
|
85
124
|
const shouldReconnect = statusCode !== DisconnectReason.loggedOut;
|
|
86
125
|
|
|
87
126
|
if (shouldReconnect) {
|
|
127
|
+
console.log("🔄 Wiederverbindung...");
|
|
88
128
|
this.isConnected = false;
|
|
89
129
|
this.socket = null;
|
|
90
130
|
setTimeout(() => this.connect().then(resolve).catch(reject), 3000);
|
|
91
131
|
} else {
|
|
132
|
+
console.log("👋 Ausgeloggt");
|
|
92
133
|
await closeBrowser();
|
|
93
134
|
this.emit('disconnected', { reason: 'logged_out' });
|
|
94
135
|
reject(new Error('Logged out'));
|
|
@@ -96,7 +137,7 @@ export class WhatsAppClient {
|
|
|
96
137
|
} else if (connection === "open") {
|
|
97
138
|
console.log("✅ WhatsApp verbunden!");
|
|
98
139
|
this.isConnected = true;
|
|
99
|
-
|
|
140
|
+
await closeBrowser(); // QR Browser schließen
|
|
100
141
|
this.emit('connected');
|
|
101
142
|
resolve(this);
|
|
102
143
|
}
|
|
@@ -157,14 +198,39 @@ export class WhatsAppClient {
|
|
|
157
198
|
}
|
|
158
199
|
|
|
159
200
|
setupEventHandlers() {
|
|
160
|
-
// Messages
|
|
201
|
+
// Messages - Saubere Message-Erkennung ohne Debug-Spam
|
|
161
202
|
this.socket.ev.on("messages.upsert", ({ messages, type }) => {
|
|
162
|
-
|
|
203
|
+
// Nur relevante Message-Types verarbeiten
|
|
204
|
+
if (type !== "notify" && type !== "append") return;
|
|
163
205
|
|
|
164
|
-
messages.forEach(msg => {
|
|
206
|
+
messages.forEach((msg) => {
|
|
207
|
+
// Bessere Message-Validierung
|
|
165
208
|
if (!msg.message || msg.key.fromMe) return;
|
|
209
|
+
|
|
210
|
+
// Ignoriere System-Messages (protocolMessage, etc.)
|
|
211
|
+
if (msg.message.protocolMessage ||
|
|
212
|
+
msg.message.reactionMessage ||
|
|
213
|
+
msg.message.ephemeralMessage ||
|
|
214
|
+
msg.message.viewOnceMessage) {
|
|
215
|
+
return; // Ignoriere ohne Debug-Output
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Ignoriere Broadcast-Messages
|
|
219
|
+
if (msg.key.remoteJid && isJidBroadcast(msg.key.remoteJid)) return;
|
|
166
220
|
|
|
167
221
|
const messageData = this.parseMessage(msg);
|
|
222
|
+
|
|
223
|
+
// Nur verarbeiten wenn Text vorhanden oder unterstützte Typen
|
|
224
|
+
if (!messageData.text &&
|
|
225
|
+
!['image', 'video', 'audio', 'document', 'sticker', 'location', 'contact'].includes(messageData.type)) {
|
|
226
|
+
return; // Ignoriere ohne Debug-Output
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Nur bei echten Nachrichten loggen
|
|
230
|
+
if (messageData.text || messageData.type !== 'unknown') {
|
|
231
|
+
console.log(`📨 ${messageData.type}: "${messageData.text || '[Media]'}" von ${messageData.from}`);
|
|
232
|
+
}
|
|
233
|
+
|
|
168
234
|
const messageObj = new Message(this, messageData);
|
|
169
235
|
|
|
170
236
|
// Prefix System - Command Check
|
|
@@ -172,6 +238,8 @@ export class WhatsAppClient {
|
|
|
172
238
|
const commandText = messageData.text.slice(this.prefix.length).trim();
|
|
173
239
|
const [command, ...args] = commandText.split(' ');
|
|
174
240
|
|
|
241
|
+
console.log(`⚡ Command: ${this.prefix}${command}`);
|
|
242
|
+
|
|
175
243
|
messageObj.isCommand = true;
|
|
176
244
|
messageObj.command = command.toLowerCase();
|
|
177
245
|
messageObj.args = args;
|
|
@@ -199,24 +267,49 @@ export class WhatsAppClient {
|
|
|
199
267
|
});
|
|
200
268
|
});
|
|
201
269
|
|
|
202
|
-
//
|
|
203
|
-
this.socket.ev.on("
|
|
204
|
-
this.emit('
|
|
270
|
+
// Andere Events ohne Debug-Spam
|
|
271
|
+
this.socket.ev.on("messages.update", (updates) => {
|
|
272
|
+
this.emit('messages.update', updates);
|
|
205
273
|
});
|
|
206
274
|
|
|
207
|
-
// Presence updates
|
|
208
275
|
this.socket.ev.on("presence.update", (update) => {
|
|
209
276
|
this.emit('presence.update', update);
|
|
210
277
|
});
|
|
278
|
+
|
|
279
|
+
this.socket.ev.on("group-participants.update", (update) => {
|
|
280
|
+
this.emit('group.participants.update', update);
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
this.socket.ev.on("chats.upsert", (chats) => {
|
|
284
|
+
this.emit('chats.upsert', chats);
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
this.socket.ev.on("contacts.upsert", (contacts) => {
|
|
288
|
+
this.emit('contacts.upsert', contacts);
|
|
289
|
+
});
|
|
211
290
|
}
|
|
212
291
|
|
|
213
292
|
parseMessage(msg) {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
msg.message.
|
|
219
|
-
|
|
293
|
+
// Erweiterte Text-Extraktion für verschiedene Message-Typen
|
|
294
|
+
let text = null;
|
|
295
|
+
|
|
296
|
+
if (msg.message.conversation) {
|
|
297
|
+
text = msg.message.conversation;
|
|
298
|
+
} else if (msg.message.extendedTextMessage?.text) {
|
|
299
|
+
text = msg.message.extendedTextMessage.text;
|
|
300
|
+
} else if (msg.message.imageMessage?.caption) {
|
|
301
|
+
text = msg.message.imageMessage.caption;
|
|
302
|
+
} else if (msg.message.videoMessage?.caption) {
|
|
303
|
+
text = msg.message.videoMessage.caption;
|
|
304
|
+
} else if (msg.message.documentMessage?.caption) {
|
|
305
|
+
text = msg.message.documentMessage.caption;
|
|
306
|
+
} else if (msg.message.buttonsResponseMessage?.selectedButtonId) {
|
|
307
|
+
text = msg.message.buttonsResponseMessage.selectedButtonId;
|
|
308
|
+
} else if (msg.message.listResponseMessage?.singleSelectReply?.selectedRowId) {
|
|
309
|
+
text = msg.message.listResponseMessage.singleSelectReply.selectedRowId;
|
|
310
|
+
} else if (msg.message.templateButtonReplyMessage?.selectedId) {
|
|
311
|
+
text = msg.message.templateButtonReplyMessage.selectedId;
|
|
312
|
+
}
|
|
220
313
|
|
|
221
314
|
return {
|
|
222
315
|
id: msg.key.id,
|
|
@@ -226,12 +319,14 @@ export class WhatsAppClient {
|
|
|
226
319
|
timestamp: msg.messageTimestamp,
|
|
227
320
|
type: this.getMessageType(msg.message),
|
|
228
321
|
isGroup: msg.key.remoteJid?.includes("@g.us"),
|
|
322
|
+
participant: msg.key.participant, // Wichtig für Gruppen
|
|
229
323
|
raw: msg
|
|
230
324
|
};
|
|
231
325
|
}
|
|
232
326
|
|
|
233
327
|
getMessageType(message) {
|
|
234
328
|
if (message.conversation) return 'text';
|
|
329
|
+
if (message.extendedTextMessage) return 'text';
|
|
235
330
|
if (message.imageMessage) return 'image';
|
|
236
331
|
if (message.videoMessage) return 'video';
|
|
237
332
|
if (message.audioMessage) return 'audio';
|
|
@@ -239,6 +334,11 @@ export class WhatsAppClient {
|
|
|
239
334
|
if (message.stickerMessage) return 'sticker';
|
|
240
335
|
if (message.locationMessage) return 'location';
|
|
241
336
|
if (message.contactMessage) return 'contact';
|
|
337
|
+
if (message.buttonsResponseMessage) return 'button_response';
|
|
338
|
+
if (message.listResponseMessage) return 'list_response';
|
|
339
|
+
if (message.templateButtonReplyMessage) return 'template_button_reply';
|
|
340
|
+
if (message.pollCreationMessage) return 'poll';
|
|
341
|
+
if (message.pollUpdateMessage) return 'poll_update';
|
|
242
342
|
return 'unknown';
|
|
243
343
|
}
|
|
244
344
|
|
package/src/qr.js
CHANGED
|
@@ -6,26 +6,10 @@ let page = null;
|
|
|
6
6
|
|
|
7
7
|
export async function generateQRCode(qrData = null) {
|
|
8
8
|
try {
|
|
9
|
-
//
|
|
10
|
-
if (!browser) {
|
|
11
|
-
console.log("🌐 Öffne Microsoft Edge...");
|
|
12
|
-
browser = await chromium.launch({
|
|
13
|
-
channel: "msedge",
|
|
14
|
-
headless: false
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Neue Seite öffnen falls noch nicht vorhanden
|
|
19
|
-
if (!page) {
|
|
20
|
-
page = await browser.newPage();
|
|
21
|
-
await page.goto("https://web.whatsapp.com");
|
|
22
|
-
console.log("🌐 Microsoft Edge mit WhatsApp Web geöffnet");
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// QR-Code anzeigen falls vorhanden
|
|
9
|
+
// QR-Code im Terminal anzeigen falls vorhanden
|
|
26
10
|
if (qrData) {
|
|
27
11
|
console.log("\n📱 QR-CODE GENERIERT!");
|
|
28
|
-
console.log("👆 Scanne den QR-Code
|
|
12
|
+
console.log("👆 Scanne den QR-Code hier im Terminal:");
|
|
29
13
|
console.log("─".repeat(50));
|
|
30
14
|
|
|
31
15
|
// QR-Code im Terminal anzeigen
|
|
@@ -36,22 +20,147 @@ export async function generateQRCode(qrData = null) {
|
|
|
36
20
|
console.log(" 1. Gehe zu Einstellungen");
|
|
37
21
|
console.log(" 2. Tippe auf 'Verknüpfte Geräte'");
|
|
38
22
|
console.log(" 3. Tippe auf 'Gerät verknüpfen'");
|
|
39
|
-
console.log(" 4. Scanne den QR-Code");
|
|
23
|
+
console.log(" 4. Scanne den QR-Code OBEN im Terminal");
|
|
40
24
|
console.log("⏳ Warte auf QR-Scan...");
|
|
41
25
|
}
|
|
42
26
|
|
|
27
|
+
// Browser öffnen und den richtigen QR-Code anzeigen
|
|
28
|
+
if (!browser && qrData) {
|
|
29
|
+
console.log("🌐 Öffne Browser mit korrektem QR-Code...");
|
|
30
|
+
browser = await chromium.launch({
|
|
31
|
+
channel: "msedge",
|
|
32
|
+
headless: false
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
page = await browser.newPage();
|
|
36
|
+
|
|
37
|
+
// Custom HTML-Seite mit dem richtigen QR-Code erstellen
|
|
38
|
+
const qrCodeDataURL = await generateQRCodeDataURL(qrData);
|
|
39
|
+
const html = `
|
|
40
|
+
<!DOCTYPE html>
|
|
41
|
+
<html>
|
|
42
|
+
<head>
|
|
43
|
+
<title>WAEngine - QR Code Scanner</title>
|
|
44
|
+
<style>
|
|
45
|
+
body {
|
|
46
|
+
font-family: Arial, sans-serif;
|
|
47
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
48
|
+
margin: 0;
|
|
49
|
+
padding: 20px;
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
min-height: 100vh;
|
|
55
|
+
color: white;
|
|
56
|
+
}
|
|
57
|
+
.container {
|
|
58
|
+
background: rgba(255, 255, 255, 0.1);
|
|
59
|
+
backdrop-filter: blur(10px);
|
|
60
|
+
border-radius: 20px;
|
|
61
|
+
padding: 40px;
|
|
62
|
+
text-align: center;
|
|
63
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
|
|
64
|
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
65
|
+
}
|
|
66
|
+
h1 {
|
|
67
|
+
margin-bottom: 20px;
|
|
68
|
+
font-size: 2.5em;
|
|
69
|
+
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
|
|
70
|
+
}
|
|
71
|
+
.qr-container {
|
|
72
|
+
background: white;
|
|
73
|
+
padding: 20px;
|
|
74
|
+
border-radius: 15px;
|
|
75
|
+
margin: 20px 0;
|
|
76
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
|
|
77
|
+
}
|
|
78
|
+
.qr-code {
|
|
79
|
+
max-width: 300px;
|
|
80
|
+
height: auto;
|
|
81
|
+
}
|
|
82
|
+
.instructions {
|
|
83
|
+
font-size: 1.2em;
|
|
84
|
+
line-height: 1.6;
|
|
85
|
+
margin-top: 20px;
|
|
86
|
+
}
|
|
87
|
+
.step {
|
|
88
|
+
margin: 10px 0;
|
|
89
|
+
padding: 10px;
|
|
90
|
+
background: rgba(255, 255, 255, 0.1);
|
|
91
|
+
border-radius: 10px;
|
|
92
|
+
}
|
|
93
|
+
.warning {
|
|
94
|
+
background: rgba(255, 193, 7, 0.2);
|
|
95
|
+
border: 2px solid #ffc107;
|
|
96
|
+
border-radius: 10px;
|
|
97
|
+
padding: 15px;
|
|
98
|
+
margin: 20px 0;
|
|
99
|
+
font-weight: bold;
|
|
100
|
+
}
|
|
101
|
+
</style>
|
|
102
|
+
</head>
|
|
103
|
+
<body>
|
|
104
|
+
<div class="container">
|
|
105
|
+
<h1>🚀 WAEngine QR Scanner</h1>
|
|
106
|
+
<div class="qr-container">
|
|
107
|
+
<img src="${qrCodeDataURL}" alt="QR Code" class="qr-code" />
|
|
108
|
+
</div>
|
|
109
|
+
<div class="warning">
|
|
110
|
+
⚠️ Scanne NUR diesen QR-Code!<br>
|
|
111
|
+
Nicht den Standard WhatsApp Web QR-Code!
|
|
112
|
+
</div>
|
|
113
|
+
<div class="instructions">
|
|
114
|
+
<div class="step">📱 1. Öffne WhatsApp auf deinem Handy</div>
|
|
115
|
+
<div class="step">⚙️ 2. Gehe zu Einstellungen</div>
|
|
116
|
+
<div class="step">🔗 3. Tippe auf "Verknüpfte Geräte"</div>
|
|
117
|
+
<div class="step">📷 4. Tippe auf "Gerät verknüpfen"</div>
|
|
118
|
+
<div class="step">🎯 5. Scanne den QR-Code oben</div>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
<script>
|
|
122
|
+
// Auto-refresh QR code every 30 seconds
|
|
123
|
+
setTimeout(() => {
|
|
124
|
+
location.reload();
|
|
125
|
+
}, 30000);
|
|
126
|
+
</script>
|
|
127
|
+
</body>
|
|
128
|
+
</html>`;
|
|
129
|
+
|
|
130
|
+
await page.setContent(html);
|
|
131
|
+
console.log("✅ Browser mit korrektem QR-Code geöffnet!");
|
|
132
|
+
}
|
|
133
|
+
|
|
43
134
|
return { browser, page };
|
|
44
135
|
|
|
45
136
|
} catch (error) {
|
|
46
|
-
console.error("❌ Fehler beim
|
|
137
|
+
console.error("❌ Fehler beim QR-Code Browser:", error);
|
|
47
138
|
|
|
48
139
|
// Fallback: QR nur im Terminal
|
|
49
140
|
if (qrData) {
|
|
50
|
-
console.log("📱 Fallback - QR-Code im Terminal:");
|
|
141
|
+
console.log("📱 Fallback - QR-Code nur im Terminal:");
|
|
51
142
|
qrcode.generate(qrData, { small: true });
|
|
52
143
|
}
|
|
53
144
|
|
|
54
|
-
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Hilfsfunktion um QR-Code als Data URL zu generieren
|
|
150
|
+
async function generateQRCodeDataURL(qrData) {
|
|
151
|
+
try {
|
|
152
|
+
const QRCode = await import('qrcode');
|
|
153
|
+
return await QRCode.toDataURL(qrData, {
|
|
154
|
+
width: 300,
|
|
155
|
+
margin: 2,
|
|
156
|
+
color: {
|
|
157
|
+
dark: '#000000',
|
|
158
|
+
light: '#FFFFFF'
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
} catch (error) {
|
|
162
|
+
console.error("❌ Fehler beim QR-Code DataURL:", error);
|
|
163
|
+
return 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAwIiBoZWlnaHQ9IjMwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMzAwIiBoZWlnaHQ9IjMwMCIgZmlsbD0iI2Y4ZjlmYSIvPjx0ZXh0IHg9IjE1MCIgeT0iMTUwIiBmb250LWZhbWlseT0iQXJpYWwiIGZvbnQtc2l6ZT0iMTYiIGZpbGw9IiM2NjY2NjYiIHRleHQtYW5jaG9yPSJtaWRkbGUiPkVycm9yPC90ZXh0Pjwvc3ZnPg==';
|
|
55
164
|
}
|
|
56
165
|
}
|
|
57
166
|
|
|
@@ -62,4 +171,4 @@ export async function closeBrowser() {
|
|
|
62
171
|
page = null;
|
|
63
172
|
console.log("🔴 Browser geschlossen");
|
|
64
173
|
}
|
|
65
|
-
}
|
|
174
|
+
}
|