core

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProcessingReaction = "🤖"
	DoneReaction       = "✅"
	FailedReaction     = "❌"
	QuestionReaction   = "❓"
)

Variables

This section is empty.

Functions

func NewUploading

func NewUploading(
	file io.Reader,
	opts ...UploadingOptions,
) http.MultipartFile

Types

type AuthToken

type AuthToken string

func (AuthToken) AuthToken

type Client

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

func New

func New(token AuthToken, opts ...Options) (Client, error)

func (Client) CommandGetList

func (c Client) CommandGetList(
	ctx context.Context,
) (CommandList, error)

CommandGetList invokes POST /command/getList operation.

Получить список команд бота.

POST /command/getList

func (Client) CommandUpdate

func (c Client) CommandUpdate(
	ctx context.Context,
	command ...Command,
) error

CommandUpdate invokes POST /command/update operation.

Обновить список команд бота.

POST /command/update

func (Client) FileGetURL

func (c Client) FileGetURL(ctx context.Context) (*FileNode, error)

FileGetURL invokes POST /file/getUrl operation.

Получить URL для загрузки файлов.

POST /file/getUrl

func (Client) FileUpload

func (c Client) FileUpload(
	ctx context.Context,
	file http.MultipartFile,
) (fileID string, _ error)

FileUpload invokes POST {node_url} operation.

Загрузка файла.

POST {node_url}

func (Client) Group

func (c Client) Group(id string) Group

func (Client) GroupGetList

func (c Client) GroupGetList(
	ctx context.Context,
	request Pagination,
) (GroupList, error)

GroupGetList invokes POST /group/getList operation.

Получить данные групп, в которых состоит бот.

POST /group/getList

func (Client) Message

func (c Client) Message(id string) Message

func (Client) User

func (c Client) User(id int64) User

func (Client) UserGetList

func (c Client) UserGetList(
	ctx context.Context,
	request Pagination,
) (UserList, error)

UserGetList invokes POST /user/getList operation.

Получить данные об участниках команды.

POST /user/getList

func (Client) WebhookGetVersion

func (c Client) WebhookGetVersion(ctx context.Context) (version int, _ error)

WebhookGetVersion invokes POST /webhook/getVersion operation.

Получить текущую версию webhook бота.

POST /webhook/getVersion

func (Client) WebhookSetVersion

func (c Client) WebhookSetVersion(
	ctx context.Context,
	version int,
) error

WebhookSetVersion invokes POST /webhook/setVersion operation.

Установить версию для webhook бота.

POST /webhook/setVersion

type Command

type Command = api.Command

type CommandList

type CommandList = []Command

type ErrorResponse

type ErrorResponse api.ErrorResponseResponse

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

type FileNode

type Fmt

type Fmt string

func (Fmt) Black

func (s Fmt) Black() Fmt

func (Fmt) Bold

func (s Fmt) Bold() Fmt

func (Fmt) Crossline

func (s Fmt) Crossline() Fmt

func (Fmt) Green

func (s Fmt) Green() Fmt

func (Fmt) Italic

func (s Fmt) Italic() Fmt

func (Fmt) Pink

func (s Fmt) Pink() Fmt

func (Fmt) String

func (s Fmt) String() string

type Group

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

func (Group) SendFile

func (g Group) SendFile(ctx context.Context, fileID string) (messageID string, err error)

SendFile invokes POST /group/send operation.

Отправить сообщение от бота в группу.

POST /group/send

func (Group) SendText

func (g Group) SendText(ctx context.Context, text string) (messageID string, err error)

SendText invokes POST /group/send operation.

Отправить сообщение от бота в группу.

POST /group/send

type Message

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

func (Message) AddReaction

func (m Message) AddReaction(
	ctx context.Context,
	reaction string,
) error

AddReaction invokes POST /message/addReaction operation.

Добавить реакцию на сообщение от лица бота.

POST /message/addReaction

func (Message) RemoveReaction

func (m Message) RemoveReaction(
	ctx context.Context,
	reaction string,
) error

RemoveReaction invokes POST /message/removeReaction operation.

Удалить реакцию бота с сообщения.

POST /message/removeReaction

func (Message) ReplyFile

func (m Message) ReplyFile(
	ctx context.Context,
	fileID string,
) (messageID string, err error)

ReplyFile invokes POST /thread/send operation.

Отправить сообщение от бота в комментарии к сообщению.

POST /thread/send

func (Message) ReplyText

func (m Message) ReplyText(
	ctx context.Context,
	text string,
) (messageID string, err error)

ReplyText invokes POST /thread/send operation.

Отправить сообщение от бота в комментарии к сообщению.

POST /thread/send

type Options

type Options struct {
	URL        string
	HttpClient *http.Client
}

type Pagination

type Pagination = api.GetListRequest

type Tag

type Tag struct{}

func (Tag) All

func (t Tag) All() string

All returns a string that tags all users in a message.

func (Tag) User

func (t Tag) User(id int64, name string) string

User returns a string that tags the given user in a message.

type UploadingOptions

type UploadingOptions struct {
	FileName    string
	ContentType string
}

type User

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

func (User) SendFile

func (u User) SendFile(ctx context.Context, fileID string) (messageID string, err error)

SendFile invokes POST /user/send operation.

Отправить сообщение от бота конкретному участнику.

POST /user/send

func (User) SendText

func (u User) SendText(ctx context.Context, text string) (messageID string, err error)

SendText invokes POST /user/send operation.

Отправить сообщение от бота конкретному участнику.

POST /user/send

Jump to

Keyboard shortcuts

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