go-whatsapp icon indicating copy to clipboard operation
go-whatsapp copied to clipboard

Save Qr Code Image

Open 0xhex opened this issue 4 years ago • 4 comments

Hello,i couldn't find the qr code string in source. I want to save qr code image as a file,i dont want to show it in terminal Any help?

0xhex avatar Dec 24 '19 09:12 0xhex

The Login method for the type *whatsapp.Conn writes the QR Code data into a string channel. You can use this channel to generate a QR Code Image and save it to a file. The login example shows how to handle the QR Code data using a goroutine and the terminal. The same concept can be applied to an image based approach.

abnt713 avatar Dec 30 '19 14:12 abnt713

Use github.com/skip2/go-qrcode

To visualize the QR code to PNG.

kaxap avatar Jan 07 '20 16:01 kaxap

Yo hice lo siguiente:

terminal := qrcodeTerminal.New()
qrCode := <-qr
terminal.Get(qrCode).Print()
qrToImg(qrCode)

func qrToImg(qrCode string) {

	err := qrcode.WriteFile(qrCode, qrcode.Medium, 256, "qr.png")
	if err != nil {
		fmt.Fprintf(os.Stderr, "No se pudo crear el archivo de imagen QR")
	} 
}

e1milio avatar Feb 10 '20 12:02 e1milio

how to show QR.png in go window form using github.com/lxn/walk... any solution...

manishswami avatar May 27 '21 15:05 manishswami