Skip to content

Commit e15e559

Browse files
committed
fix: remove Resend dependency
Signed-off-by: Matheus Cruz <[email protected]>
1 parent f42e8d6 commit e15e559

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

whatsapp/src/index.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ if (process.env.ENV !== "production") {
1717
}
1818

1919
const QRCode = require("qrcode")
20-
import { Resend } from "resend"
2120
const { Client, LocalAuth } = require("whatsapp-web.js")
2221
const qrcode = require("qrcode-terminal")
2322
const crypto = require("crypto")
@@ -93,8 +92,6 @@ const client = new Client({
9392
})
9493

9594
client.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

Comments
 (0)