pachka

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

README

PACHKA Plugin

Documentation

Documentation

Index

Constants

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

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

	Version = "0.0.1"
)

Variables

Functions

func New

func New() supervisor.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 added in v0.18.1

type Actor struct {
	*supervisor.BaseActor

	AccessToken string
	// contains filtered or unexported fields
}

Actor ...

func NewActor added in v0.18.1

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

NewActor ...

func (*Actor) Destroy added in v0.18.1

func (e *Actor) Destroy()

func (*Actor) MessageParams added in v0.18.1

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

MessageParams ...

func (*Actor) Save added in v0.18.1

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

func (*Actor) Send added in v0.18.1

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

Send ...

func (*Actor) Spawn added in v0.18.1

func (e *Actor) Spawn()

func (*Actor) UpdateStatus added in v0.18.1

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