Documentation
¶
Index ¶
- func Auth(phone string, appID int64, appHash string, sessionPath string, password string, ...) error
- type Client
- func (c *Client) GetDialogs(args DialogsArguments) (*mcp.ToolResponse, error)
- func (c *Client) GetHistory(args HistoryArguments) (*mcp.ToolResponse, error)
- func (c *Client) GetMe(_ EmptyArguments) (*mcp.ToolResponse, error)
- func (c *Client) ReadHistory(args ReadArguments) (*mcp.ToolResponse, error)
- func (c *Client) SendDraft(args DraftArguments) (*mcp.ToolResponse, error)
- func (c *Client) T() *telegram.Client
- type DialogInfo
- type DialogType
- type DialogsArguments
- type DialogsOffset
- type DialogsResponse
- type DraftArguments
- type DraftResponse
- type EmptyArguments
- type HistoryArguments
- type HistoryResponse
- type MeResponse
- type MessageInfo
- type ReadArguments
- type ReadResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetDialogs ¶
func (c *Client) GetDialogs(args DialogsArguments) (*mcp.ToolResponse, error)
GetDialogs returns a list of dialogs (chats, channels, groups)
func (*Client) GetHistory ¶
func (c *Client) GetHistory(args HistoryArguments) (*mcp.ToolResponse, error)
func (*Client) GetMe ¶
func (c *Client) GetMe(_ EmptyArguments) (*mcp.ToolResponse, error)
func (*Client) ReadHistory ¶ added in v0.1.12
func (c *Client) ReadHistory(args ReadArguments) (*mcp.ToolResponse, error)
func (*Client) SendDraft ¶ added in v0.1.11
func (c *Client) SendDraft(args DraftArguments) (*mcp.ToolResponse, error)
type DialogInfo ¶
type DialogInfo struct {
Name string `json:"name,omitempty"`
Type string `json:"type"`
Title string `json:"title"`
LastMessage *MessageInfo `json:"last_message,omitempty"`
Empty bool `json:"empty,omitempty"`
}
type DialogType ¶
type DialogType string
DialogType represents the type of dialog for filtering
const ( DialogTypeUnknown DialogType = "unknown" DialogTypeAll DialogType = "" DialogTypeUser DialogType = "user" DialogTypeBot DialogType = "bot" DialogTypeChat DialogType = "chat" DialogTypeChannel DialogType = "channel" DefaultDialogsLimit = 100 )
type DialogsArguments ¶
type DialogsArguments struct {
Offset string `json:"offset,omitempty" jsonschema:"description=Offset for continuation"`
OnlyUnread bool `json:"only_unread,omitempty" jsonschema:"description=Include only dialogs with unread mark"`
}
nolint:lll
type DialogsOffset ¶
type DialogsOffset struct {
MsgID int `json:"msg_id"`
Date int `json:"offset_date"`
Peer tg.InputPeerClass
}
func (DialogsOffset) MarshalJSON ¶
func (o DialogsOffset) MarshalJSON() ([]byte, error)
func (*DialogsOffset) String ¶
func (o *DialogsOffset) String() string
func (*DialogsOffset) UnmarshalJSON ¶
func (o *DialogsOffset) UnmarshalJSON(data []byte) error
type DialogsResponse ¶
type DialogsResponse struct {
Dialogs []DialogInfo `json:"dialogs"`
Offset DialogsOffset `json:"offset"`
}
type DraftArguments ¶ added in v0.1.11
type DraftResponse ¶ added in v0.1.11
type DraftResponse struct {
Success bool `json:"success"`
}
type EmptyArguments ¶
type EmptyArguments struct{}
type HistoryArguments ¶
type HistoryResponse ¶
type HistoryResponse struct {
Messages []MessageInfo `json:"messages"`
Offset int `json:"offset,omitempty"`
}
type MeResponse ¶
type MeResponse struct {
ID int64 `json:"id" jsonschema:"required,description=User ID"`
FirstName string `json:"first_name" jsonschema:"required,description=User's first name"`
LastName string `json:"last_name" jsonschema:"description=User's last name"`
Username string `json:"username" jsonschema:"description=User's username"`
}
type MessageInfo ¶
type ReadArguments ¶ added in v0.1.12
type ReadArguments struct {
Name string `json:"name" jsonschema:"description=Name of the dialog"`
}
type ReadResponse ¶ added in v0.1.12
type ReadResponse struct {
Result string `json:"result"`
}
Click to show internal directories.
Click to hide internal directories.