whatsapp

package
v0.0.0-...-2ed53ce Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogLevel       = "INFO"
	LogLevelDB     = "INFO"
	LogLevelDevice = "INFO"
)

Variables

View Source
var (
	ErrClientAlreadyExist = errors.New("whatsapp client with specific id already exist")
	ErrClientNotExist     = errors.New("whatsapp client is not exits")
	ErrQRAlreadyExist     = errors.New("qrcode with specific id already exist")
	ErrQRNotExist         = errors.New("qrcode is not exits")
)
View Source
var (
	ErrServerUnexpected  = errors.New("server error occurred")
	ErrAlreadyConnected  = errors.New("device already connected")
	ErrNotLogin          = errors.New("device not login yet")
	ErrRecipientNotFound = errors.New("recipient number not found")
)
View Source
var Upgrades = [1]upgradeFunc{version1}

Functions

func IsGroupJid

func IsGroupJid(jid string) bool

func IsOnWhatsapp

func IsOnWhatsapp(waCli *whatsmeow.Client, jid string) bool

func ParseJID

func ParseJID(arg string) (types.JID, error)

Types

type Client

type Client struct {
	WA map[string]*whatsmeow.Client
	QR map[string]string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(opts ...Option) *Client

func (*Client) Backup

func (c *Client) Backup()

func (*Client) Get

func (c *Client) Get(clientDeviceID string) *whatsmeow.Client

func (*Client) GetQR

func (c *Client) GetQR(clientDeviceID string) string

func (*Client) NewMeow

func (c *Client) NewMeow(clientDeviceID string) *whatsmeow.Client

func (*Client) Reset

func (c *Client) Reset(clientDeviceID string) error

func (*Client) ResetQR

func (c *Client) ResetQR(clientDeviceID string) error

func (*Client) Restore

func (c *Client) Restore()

func (*Client) Set

func (c *Client) Set(clientDeviceID string, cli *whatsmeow.Client) error

func (*Client) SetQR

func (c *Client) SetQR(clientDeviceID string, qr string) error

func (*Client) Upgrade

func (c *Client) Upgrade() error

type Device

type Device struct {
	ID             int    `db:"id"`
	JID            string `db:"jid"`
	ClientDeviceID string `db:"client_device_id"`
}

type DeviceRepo

type DeviceRepo struct {
	// contains filtered or unexported fields
}

func (*DeviceRepo) GetDeviceByJID

func (r *DeviceRepo) GetDeviceByJID(jid string) (*Device, error)

func (*DeviceRepo) Reset

func (r *DeviceRepo) Reset(clientDeviceID string) error

func (*DeviceRepo) SetJID

func (r *DeviceRepo) SetJID(clientDeviceID string, jid string) (int, error)

type EventHandler

type EventHandler func(cli *whatsmeow.Client, clientDeviceID string) whatsmeow.EventHandler

type Migration

type Migration struct {
	// contains filtered or unexported fields
}

func (*Migration) Upgrade

func (m *Migration) Upgrade() error

type Option

type Option func(c *Client)

func WithDB

func WithDB(db *sql.DB) Option

func WithEventHandler

func WithEventHandler(handler EventHandler) Option

func WithOsInfo

func WithOsInfo(name string, version [3]uint32) Option

Jump to

Keyboard shortcuts

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