You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
477 B
Go

package main
import (
"log"
"github.com/Rhymen/go-whatsapp"
)
type WhappHandler struct {
BridgeContext *BridgeContext
MessageWorker *MessageWorker
}
func (h *WhappHandler) HandleError(err error) {
log.Println("Whatsapp Error: " + err.Error())
}
func (h *WhappHandler) HandleTextMessage(m whatsapp.TextMessage) {
handler := MessageHandler{
Jid: m.Info.RemoteJid,
Action: MakeTextMessageAction(h.BridgeContext, m),
}
h.MessageWorker.HandleMessage(handler)
}