API

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: MIT Imports: 9 Imported by: 0

README

Application Programming Interface

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetForward added in v0.1.5

func GetForward(chatID, ID int, reply bool) string

func GetRandom added in v0.1.5

func GetRandom() int

Types

type Error

type Error struct {
	Code    int           `json:"error_code"`
	Message string        `json:"error_msg"`
	Params  []ErrorParams `json:"request_params"`
}

type ErrorParams

type ErrorParams struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Forward added in v0.1.5

type Forward struct {
	ChatID int  `json:"peer_id"`
	ID     int  `json:"conversation_message_ids"`
	Reply  bool `json:"is_reply"`
}

type LongpollServer added in v0.1.2

type LongpollServer struct {
	Session LongpollSession `json:"response"`
	Error   Error           `json:"error"`
}

type LongpollSession added in v0.1.2

type LongpollSession struct {
	Server string      `json:"server"`
	Key    string      `json:"key"`
	TS     interface{} `json:"ts"`
}

type Message

type Message struct {
	ChatIDs  int `strly:"peer_ids"`
	ChatID   int `strly:"peer_id"`
	UserID   int `strly:"from_id"`
	RandomID int `strly:"random_id"`
	ID       int `strly:"conversation_message_id"`

	Text       string `strly:"message"`
	Attachment string `strly:"attachment"`
	Template   string `strly:"template"`
	Forward    string `strly:"forward"`
	Keyboard   string `strly:"keyboard"`

	KeepForward     int `strly:"keep_forward_messages"`
	KeepSnippets    int `strly:"keep_snippets"`
	DisableLinks    int `strly:"dont_parse_links"`
	DisableMentions int `strly:"disable_mentions"`
}

type Options

type Options struct {
	Token   string
	Tokens  *map[int]string
	ID      int
	Version float64
}

func Create

func Create() *Options

func (*Options) Config

func (bot *Options) Config(event string, option interface{}) *Options

func (*Options) DeleteMessage

func (config *Options) DeleteMessage(chatID, messageID, global int) *ResponseMessages

func (*Options) DeleteMessages

func (config *Options) DeleteMessages(chatID int, messagesID []int, global int) *ResponseMessages

func (*Options) EditMessage added in v0.1.5

func (config *Options) EditMessage(message Message) *ResponseMessages

func (*Options) EditPhoto

func (config *Options) EditPhoto(chatID, messageID, ownerID, photoID int) *ResponseMessages

func (*Options) EditText

func (config *Options) EditText(chatID, messageID int, text string) *ResponseMessages

func (*Options) Execute

func (config *Options) Execute(method string, params interface{}) []byte

func (*Options) GetGroup added in v0.1.2

func (config *Options) GetGroup(groupID int) *ResponseGroupsByID

func (*Options) GetGroupID

func (config *Options) GetGroupID(groupID int) int

func (*Options) GetMessageByID

func (config *Options) GetMessageByID(messageID int) *ResponseMessagesByID

func (*Options) GetServerGroupLongpoll

func (config *Options) GetServerGroupLongpoll(groupID int) *ResponseLongpollServer

func (*Options) GetServerUserLongpoll

func (config *Options) GetServerUserLongpoll() *ResponseLongpollServer

func (*Options) GetUser

func (config *Options) GetUser(userID int, fields ...string) *ResponseUsers

func (*Options) HeaderExecute

func (config *Options) HeaderExecute(method string, params string) []byte

func (*Options) PinMessage

func (config *Options) PinMessage(chatID, messageID int)

func (*Options) SendForwardedText

func (config *Options) SendForwardedText(chatID, messageID int, text string) *ResponseMessages

func (*Options) SendMessage

func (config *Options) SendMessage(message Message) *ResponseMessages

func (*Options) SendPhoto

func (config *Options) SendPhoto(chatID, ownerID, photoID int) *ResponseMessages

func (*Options) SendSticker

func (config *Options) SendSticker(chatID, stickerID int) *ResponseMessages

func (*Options) SendText

func (config *Options) SendText(chatID int, text string) *ResponseMessages

type ResponseGroup added in v0.1.5

type ResponseGroup struct {
	ID         int    `json:"id"`
	Name       string `json:"name"`
	ScreenName string `json:"screen_name"`
	Closed     bool   `json:"is_closed"`
	Type       string `json:"type"`
}

type ResponseGroups added in v0.1.5

type ResponseGroups struct {
	Groups []ResponseGroup `json:"groups"`
}

type ResponseGroupsByID added in v0.1.5

type ResponseGroupsByID struct {
	Bot      *Options
	Body     []byte
	Response ResponseGroups `json:"response"`
	Error    Error          `json:"error"`
}

func (*ResponseGroupsByID) GetGroup added in v0.1.6

func (groups *ResponseGroupsByID) GetGroup() *ResponseGroup

func (*ResponseGroupsByID) Parse added in v0.1.5

func (groups *ResponseGroupsByID) Parse() *ResponseGroupsByID

type ResponseLongpollServer added in v0.1.5

type ResponseLongpollServer struct {
	Bot     *Options
	Body    []byte
	Session *ResponseLongpollSession `json:"response"`
	Error   Error                    `json:"error"`
}

func (*ResponseLongpollServer) Parse added in v0.1.5

type ResponseLongpollSession added in v0.1.5

type ResponseLongpollSession struct {
	Server string      `json:"server"`
	Key    string      `json:"key"`
	TS     interface{} `json:"ts"`
}

type ResponseMessage added in v0.1.5

type ResponseMessage struct {
	ChatID int `json:"peer_id"`
	UserID int `json:"user_id"`
	ID     int `json:"conversation_message_id"`
}

type ResponseMessageByID added in v0.1.5

type ResponseMessageByID struct {
	Count int               `json:"count"`
	Items []updates.Message `json:"items"`
}

type ResponseMessages added in v0.1.5

type ResponseMessages struct {
	Bot      *Options
	Body     []byte
	Messages []ResponseMessage `json:"response"`
	Error    Error             `json:"error"`
}

func (*ResponseMessages) DeleteMessage added in v0.1.5

func (messages *ResponseMessages) DeleteMessage(global int) *ResponseMessages

func (*ResponseMessages) EditText added in v0.1.5

func (messages *ResponseMessages) EditText(text string) *ResponseMessages

func (*ResponseMessages) GetMessage added in v0.1.5

func (messages *ResponseMessages) GetMessage() *ResponseMessage

func (*ResponseMessages) Parse added in v0.1.5

func (messages *ResponseMessages) Parse() *ResponseMessages

func (*ResponseMessages) SendText added in v0.1.5

func (messages *ResponseMessages) SendText(text string) *ResponseMessages

func (*ResponseMessages) Wait added in v0.1.5

func (messages *ResponseMessages) Wait(second int) *ResponseMessages

type ResponseMessagesByID added in v0.1.5

type ResponseMessagesByID struct {
	Bot      *Options
	Body     []byte
	Messages ResponseMessageByID `json:"response"`
	Error    Error               `json:"error"`
}

func (*ResponseMessagesByID) GetMessage added in v0.1.5

func (messages *ResponseMessagesByID) GetMessage() updates.Message

func (*ResponseMessagesByID) Parse added in v0.1.5

func (messages *ResponseMessagesByID) Parse() *ResponseMessagesByID

type ResponseUser added in v0.1.5

type ResponseUser struct {
	ID      int    `json:"id"`
	Name    string `json:"first_name"`
	Surname string `json:"last_name"`
	Gender  int    `json:"sex"`
}

type ResponseUsers added in v0.1.5

type ResponseUsers struct {
	Bot   *Options
	Body  []byte
	Users []ResponseUser `json:"response"`
	Error Error          `json:"error"`
}

func (*ResponseUsers) Name added in v0.1.5

func (users *ResponseUsers) Name() string

func (*ResponseUsers) Parse added in v0.1.5

func (users *ResponseUsers) Parse() *ResponseUsers

type StreamingServer

type StreamingServer struct {
	Session StreamingSession `json:"response"`
	Error   Error            `json:"error"`
}

type StreamingSession

type StreamingSession struct {
	Endpoint string `json:"endpoint"`
	Key      string `json:"key"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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