Documentation
¶
Index ¶
- type APIResponse
- type Bot
- type Client
- func (c *Client) Close()
- func (c *Client) DeleteMessage(ctx context.Context, messageID int) error
- func (c *Client) GetAllDialogs(ctx context.Context) ([]types.Dialog, error)
- func (c *Client) GetCategories(ctx context.Context) ([]types.Category, error)
- func (c *Client) GetConnects(ctx context.Context) (*types.Connects, error)
- func (c *Client) GetDialogWithUser(ctx context.Context, username string) ([]types.InboxMessage, error)
- func (c *Client) GetMe(ctx context.Context) (*types.Actor, error)
- func (c *Client) GetNotifications(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) GetPayerOrders(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) GetProjects(ctx context.Context, params ProjectsParams) ([]types.Project, error)
- func (c *Client) GetToken(ctx context.Context) (string, error)
- func (c *Client) GetUser(ctx context.Context, userID int) (*types.User, error)
- func (c *Client) GetWorkerOrders(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) MessageListener(ctx context.Context, messageChan chan<- *types.Message) error
- func (c *Client) SendMessage(ctx context.Context, userID int, text string) error
- func (c *Client) SetOffline(ctx context.Context) error
- func (c *Client) SetTyping(ctx context.Context, recipientID int) error
- type Config
- type Handler
- type HandlerFunc
- type ProjectsParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIResponse ¶
type APIResponse struct {
Success bool `json:"success"`
Error string `json:"error,omitempty"`
Response map[string]interface{} `json:"response,omitempty"`
}
APIResponse общий формат ответа API
type Bot ¶
type Bot struct {
*Client
// contains filtered or unexported fields
}
Bot представляет бота Kwork
func (*Bot) MessageHandler ¶
func (b *Bot) MessageHandler(text string, onStart bool, textContains string, handler HandlerFunc)
MessageHandler регистрирует обработчик сообщений
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client представляет клиент Kwork API
func (*Client) DeleteMessage ¶
DeleteMessage удаляет сообщение
func (*Client) GetAllDialogs ¶
GetAllDialogs получает все диалоги
func (*Client) GetCategories ¶
GetCategories получает категории
func (*Client) GetConnects ¶
GetConnects получает информацию о коннектах
func (*Client) GetDialogWithUser ¶
func (c *Client) GetDialogWithUser(ctx context.Context, username string) ([]types.InboxMessage, error)
GetDialogWithUser получает диалог с пользователем по имени
func (*Client) GetNotifications ¶
GetNotifications получает уведомления
func (*Client) GetPayerOrders ¶
GetPayerOrders получает заказы заказчика
func (*Client) GetProjects ¶
GetProjects получает проекты с биржи
func (*Client) GetWorkerOrders ¶
GetWorkerOrders получает заказы работника
func (*Client) MessageListener ¶
MessageListener слушает сообщения через WebSocket
func (*Client) SendMessage ¶
SendMessage отправляет сообщение пользователю
func (*Client) SetOffline ¶
SetOffline устанавливает статус оффлайн
type Handler ¶
type Handler struct {
Func HandlerFunc
Text string
OnStart bool
TextContains string
}
Handler представляет обработчик сообщения
type HandlerFunc ¶
HandlerFunc функция-обработчик сообщения