pachka

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

README

PACHKA Plugin

Documentation

Documentation

Index

Constants

View Source
const (
	// Name ...
	Name = "pachka"

	AttrToken    = "token"
	AttrEntityID = "entity_id"
	AttrBody     = "body"
)

Variables

Functions

func New

func New() plugins.Pluggable

New ...

func NewAttr

func NewAttr() m.Attributes

NewAttr ...

func NewMessageParams

func NewMessageParams() m.Attributes

NewMessageParams ...

func NewSettings

func NewSettings() m.Attributes

NewSettings ...

Types

type Actor

type Actor struct {
	*supervisor.BaseActor

	AccessToken string
	// contains filtered or unexported fields
}

Actor ...

func NewActor

func NewActor(entity *m.Entity,
	service plugins.Service) (*Actor, error)

NewActor ...

func (*Actor) Destroy

func (e *Actor) Destroy()

func (*Actor) MessageParams

func (e *Actor) MessageParams() m.Attributes

MessageParams ...

func (*Actor) Save

func (e *Actor) Save(msg notifyCommon.Message) (addresses []string, message *m.Message)

func (*Actor) Send

func (e *Actor) Send(address string, message *m.Message) (err error)

Send ...

func (*Actor) Spawn

func (e *Actor) Spawn()

func (*Actor) UpdateStatus

func (e *Actor) UpdateStatus() (err error)

UpdateStatus ...

type Client

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

func NewClient

func NewClient(accessToken string) *Client

func (*Client) SendMsg

func (p *Client) SendMsg(content string, entityId int64) (responseMessage *ResponseMessage, errs []*ErrorItem, err error)

type Command

type Command struct {
	UserName, Text string
	ChatId         int64
}

Command ...

type EntityType

type EntityType string

type ErrorItem

type ErrorItem struct {
	Key     string      `json:"key"`
	Value   interface{} `json:"value"`
	Message string      `json:"message"`
	Code    string      `json:"code"`
	Payload interface{} `json:"payload"`
}

type RequestMessage

type RequestMessage struct {
	EntityType *EntityType `json:"entity_type,omitempty"`
	EntityId   int64       `json:"entity_id,omitempty"`
	Content    string      `json:"content"`
}

type ResponseError

type ResponseError struct {
	Errors []*ErrorItem `json:"errors"`
}

type ResponseMessage

type ResponseMessage struct {
	Data struct {
		ID        int64 `json:"id"`
		ChatId    int64 `json:"chat_id"`
		Content   string
		UserId    int64
		CreatedAt time.Time
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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