Skip to content

giansalex/whatsapp-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WhatsApp Go Go

Whatsapp Bot to send and reply text messages.

WhatsApp Icon

Install

go get github.com/giansalex/whatsapp-go

Usage

package main

import "github.com/giansalex/whatsapp-go/cl"

func main() {
	client := cl.NewClient()

	client.Listen(func(msg cl.Message) {
		if msg.Text == "Hi" {
			client.SendText(msg.From, "Hello from github!")
		}
	})
}

After executing cl.NewClient() function, app will create a WhatsApp connection. If you are not logged in, it will print a QR code in the terminal. Scan it with your phone and you are ready to go!

Bot will remember the session so there is no need to authenticate everytime.