bwhatsapp

package
v1.18.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 18 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg *bridge.Config) bridge.Bridger

New Create a new WhatsApp bridge. This will be called for each [whatsapp.<server>] entry you have in the config file

Types

type Bwhatsapp

type Bwhatsapp struct {
	*bridge.Config
	// contains filtered or unexported fields
}

Bwhatsapp Bridge structure keeping all the information needed for relying

func (*Bwhatsapp) Connect

func (b *Bwhatsapp) Connect() error

Connect to WhatsApp. Required implementation of the Bridger interface https://github.com/42wim/matterbridge/blob/2cfd880cdb0df29771bf8f31df8d990ab897889d/bridge/bridge.go#L11-L16

func (*Bwhatsapp) Disconnect

func (b *Bwhatsapp) Disconnect() error

Disconnect is called while reconnecting to the bridge TODO 42wim Documentation would be helpful on when reconnects happen and what should be done in this function Required implementation of the Bridger interface https://github.com/42wim/matterbridge/blob/2cfd880cdb0df29771bf8f31df8d990ab897889d/bridge/bridge.go#L11-L16

func (*Bwhatsapp) GetProfilePicThumb added in v1.15.0

func (b *Bwhatsapp) GetProfilePicThumb(jid string) (*ProfilePicInfo, error)

func (*Bwhatsapp) HandleError

func (b *Bwhatsapp) HandleError(err error)

HandleError received from WhatsApp

func (*Bwhatsapp) HandleImageMessage added in v1.16.4

func (b *Bwhatsapp) HandleImageMessage(message whatsapp.ImageMessage)

HandleImageMessage sent from WhatsApp, relay it to the brige

func (*Bwhatsapp) HandleTextMessage

func (b *Bwhatsapp) HandleTextMessage(message whatsapp.TextMessage)

HandleTextMessage sent from WhatsApp, relay it to the brige

func (*Bwhatsapp) JoinChannel

func (b *Bwhatsapp) JoinChannel(channel config.ChannelInfo) error

JoinChannel Join a WhatsApp group specified in gateway config as channel='number-id@g.us' or channel='Channel name' Required implementation of the Bridger interface https://github.com/42wim/matterbridge/blob/2cfd880cdb0df29771bf8f31df8d990ab897889d/bridge/bridge.go#L11-L16

func (*Bwhatsapp) Login

func (b *Bwhatsapp) Login() error

Login to WhatsApp creating a new session. This will require to scan a QR code on your mobile device

func (*Bwhatsapp) PostDocumentMessage added in v1.16.4

func (b *Bwhatsapp) PostDocumentMessage(msg config.Message, filetype string) (string, error)

Post a document message from the bridge to WhatsApp

func (*Bwhatsapp) PostImageMessage added in v1.16.4

func (b *Bwhatsapp) PostImageMessage(msg config.Message, filetype string) (string, error)

Post an image message from the bridge to WhatsApp Handle, for sure image/jpeg, image/png and image/gif MIME types

func (*Bwhatsapp) Send

func (b *Bwhatsapp) Send(msg config.Message) (string, error)

Send a message from the bridge to WhatsApp Required implementation of the Bridger interface https://github.com/42wim/matterbridge/blob/2cfd880cdb0df29771bf8f31df8d990ab897889d/bridge/bridge.go#L11-L16

type ProfilePicInfo added in v1.15.0

type ProfilePicInfo struct {
	URL string `json:"eurl"`
	Tag string `json:"tag"`

	Status int16 `json:"status"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL