atmessage

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 11 Imported by: 101

README

atmessage

message helper and lib

Release

go get -u all
go mod tidy
git tag                                 #check current version
git tag v0.0.28                          #set tag version
git push origin --tags                  #push tag version to repo
go list -m github.com/aiteung/atmessage@v0.0.28   #publish to pkg dev, replace ORG/URL with your repo URL

Documentation

Index

Constants

View Source
const (
	MediaTypeImage = MediaType(iota)
	MediaTypeVideo
	MediaTypeAudio
	MediaTypeDocument
)

Variables

View Source
var (
	AppInfo = map[MediaType]string{
		MediaTypeImage:    "WhatsApp Image Keys",
		MediaTypeVideo:    "WhatsApp Video Keys",
		MediaTypeAudio:    "WhatsApp Audio Keys",
		MediaTypeDocument: "WhatsApp Document Keys",
	}
)

Functions

func GetLiveLoc

func GetLiveLoc(Message *waProto.Message) (lat float64, long float64)

func RunWA added in v0.0.18

func RunWA(handler whatsmeow.EventHandler) (waclient *whatsmeow.Client)

func SendButtonMessage

func SendButtonMessage(btnmsg ButtonsMessage, toJID types.JID, whatsapp *whatsmeow.Client) (resp whatsmeow.SendResponse, err error)

func SendDocumentMessage added in v0.0.14

func SendDocumentMessage(plaintext []byte, filename string, caption string, toJID types.JID, whatsapp *whatsmeow.Client) (resp whatsmeow.SendResponse, err error)

func SendImageMessage added in v0.0.28

func SendImageMessage(plaintext []byte, caption string, toJID types.JID, whatsapp *whatsmeow.Client) (resp whatsmeow.SendResponse, err error)

func SendListMessage

func SendListMessage(lstmsg ListMessage, toJID types.JID, whatsapp *whatsmeow.Client) (resp whatsmeow.SendResponse, err error)

func SendMessage

func SendMessage(msg string, toJID types.JID, whatsapp *whatsmeow.Client) (resp whatsmeow.SendResponse, err error)

Types

type ButtonsMessage

type ButtonsMessage struct {
	Message WaButtonsMessage `json:"message,omitempty"`
	Buttons []WaButton       `json:"buttons,omitempty"`
}

type Chat

type Chat struct {
	Phone_number string `json:"phone_number"`
	Messages     string `json:"messages"`
}

type IteungMessage

type IteungMessage struct {
	Phone_number string  `json:"phone_number"`
	Group_name   string  `json:"group_name"`
	Alias_name   string  `json:"alias_name"`
	Messages     string  `json:"messages"`
	Is_group     string  `json:"is_group"`
	Filename     string  `json:"filename"`
	Filedata     string  `json:"filedata"`
	Latitude     float64 `json:"latitude"`
	Longitude    float64 `json:"longitude"`
	Api_key      string  `json:"api_key"`
}

type IteungRespon

type IteungRespon struct {
	Message string `json:"message"`
}

type ListMessage

type ListMessage struct {
	Title       string
	Description string
	FooterText  string
	ButtonText  string
	Sections    []WaListSection
}

type MediaType

type MediaType int

type Notif

type Notif struct {
	User     string `json:"user"`
	Server   string `json:"server"`
	Messages string `json:"messages"`
}

type NotifButton

type NotifButton struct {
	User    string         `json:"user"`
	Server  string         `json:"server"`
	Message ButtonsMessage `json:"button_messages"`
}

type PhoneList

type PhoneList struct {
	Phones []string `json:"phones,omitempty"`
}

type QRScan

type QRScan struct {
	QR      string `json:"qr"`
	Status  string `json:"status"`
	Message string `json:"message"`
}

type Response

type Response struct {
	Response string `json:"response"`
}

type WaButton

type WaButton struct {
	ButtonId    string `json:"button_id,omitempty"`
	DisplayText string `json:"display_text,omitempty"`
}

type WaButtonsMessage

type WaButtonsMessage struct {
	HeaderText  string `json:"header_text,omitempty"`
	ContentText string `json:"content_text,omitempty"`
	FooterText  string `json:"footer_text,omitempty"`
}

type WaListRow

type WaListRow struct {
	Title       string
	Description string
	RowId       string
}

type WaListSection

type WaListSection struct {
	Title string
	Rows  []WaListRow
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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