@@ -17,7 +17,6 @@ if (process.env.ENV !== "production") {
1717}
1818
1919const QRCode = require ( "qrcode" )
20- import { Resend } from "resend"
2120const { Client, LocalAuth } = require ( "whatsapp-web.js" )
2221const qrcode = require ( "qrcode-terminal" )
2322const crypto = require ( "crypto" )
@@ -93,8 +92,6 @@ const client = new Client({
9392} )
9493
9594client . on ( "qr" , ( qr ) => {
96- console . log ( "Scan the following QRCode using WhatsApp" )
97-
9895 if ( process . env . ENV === "production" ) {
9996 QRCode . toDataURL ( qr , ( err , url ) => {
10097 if ( err ) {
@@ -115,13 +112,22 @@ client.on("qr", (qr) => {
115112 } )
116113 )
117114 . then ( ( ) => {
118- console . log ( "QR code uploaded to S3 successfully" )
115+ console . log ( "QR code uploaded to S3 successfully!" )
116+ console . log ( `
117+ 1. Access the S3 bucket: ${ process . env . ASSETS_BUCKET }
118+ 2. Locate the QR code image inside the whatsapp-bot folder
119+ 3. Scan the QR code with your WhatsApp mobile app to log in
120+ ` )
119121 } )
120122 . catch ( ( err ) => {
121123 console . error ( "Failed to upload QR code to S3:" , err )
122124 } )
123125 } )
124126 } else {
127+ console . log ( `
128+ 1. See the terminal for the QR code
129+ 2. Scan the QR code with your WhatsApp mobile app to log in
130+ ` )
125131 qrcode . generate ( qr , { small : true } )
126132 }
127133} )
0 commit comments