Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

> error logging in: error during login: error decoding login resp: json: cannot unmarshal array into Go value of type map[string]interface {} #656

Open
gurlivleenkainth2000 opened this issue Sep 2, 2022 · 2 comments

Comments

@gurlivleenkainth2000
Copy link

gurlivleenkainth2000 commented Sep 2, 2022

error logging in: error during login: error decoding login resp: json: cannot unmarshal array into Go value of type map[string]interface {}
Originally posted by @hrizal in #170 (comment)

Using the latest version of go-whatsapp. I am not getting qrcode on terminal with your recommened package for printing on console. Please guide me how I can get the qrcode
I've write this in main.go file and calling this function in main function. The print message in go routing is printing in the console but qrcode is not. I also used the sync package for waiting but nothing is happen.

func startConnection() {
	wac, err := whatsapp.NewConn(20 * time.Second)
	if err != nil {
		panic(err)
	}

	qrChan := make(chan string)
	// Goroutine is too print qrcode for session login
	go func() {
		fmt.Println("Print Qrcode on Terminal Started Execution")

		terminal := qrcodeTerminal.New()
		terminal.Get(<-qrChan).Print()
	}()

	sess, loginErr := wac.Login(qrChan)
	if loginErr != nil {
		fmt.Println("error during login: ", loginErr)
		return
	}
	fmt.Println("Login Session", sess)

}

And this is my go.mod file

module github.com/.../goWhatsappModule2022

go 1.19

require (
	github.com/Baozisoftware/qrcode-terminal-go v0.0.0-20170407111555-c0650d8dff0f
	github.com/Rhymen/go-whatsapp v0.1.1
)

require (
	github.com/golang/protobuf v1.3.0 // indirect
	github.com/gorilla/websocket v1.4.1 // indirect
	github.com/mattn/go-colorable v0.1.1 // indirect
	github.com/mattn/go-isatty v0.0.5 // indirect
	github.com/pkg/errors v0.8.1 // indirect
	github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9 // indirect
	golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 // indirect
	golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 // indirect
)
@ying-jeanne
Copy link

I have the same issue when trying to login

@gurlivleenkainth2000
Copy link
Author

Please use this golang package go.mau.fi/whatsmeow. It is superb package and well maintained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants