Documentation
¶
Index ¶
- type AuthErrorMsg
- type AuthorizedMsg
- type Chat
- type ChatType
- type Client
- func (c *Client) API() *tg.Client
- func (c *Client) Context() context.Context
- func (c *Client) DownloadPhoto(msgID int, info *MediaInfo) func() interface{}
- func (c *Client) DownloadToFile(msgID int, info *MediaInfo, destPath string) func() interface{}
- func (c *Client) FetchDialogs() func() interface{}
- func (c *Client) FetchHistory(chat Chat) func() interface{}
- func (c *Client) FetchOlderHistory(chat Chat, offsetID int) func() interface{}
- func (c *Client) ForwardMessages(fromChat Chat, messageIDs []int, toChat Chat) func() interface{}
- func (c *Client) LoggedIn() qrlogin.LoggedIn
- func (c *Client) Run() error
- func (c *Client) SearchHistory(chat Chat, query string) func() interface{}
- func (c *Client) SelfID() int64
- func (c *Client) SendCode(phone string) func() interface{}
- func (c *Client) SendMessage(chat Chat, text string) func() interface{}
- func (c *Client) SetProgram(p *tea.Program)
- func (c *Client) SignIn(phone, code, phoneCodeHash string) func() interface{}
- func (c *Client) StartQRLogin(loggedIn qrlogin.LoggedIn) func() interface{}
- func (c *Client) Stop()
- func (c *Client) Submit2FA(password string) func() interface{}
- type CodeSentMsg
- type DialogsErrorMsg
- type DialogsLoadedMsg
- type DownloadPhotoErrorMsg
- type DownloadPhotoMsg
- type FileSessionStorage
- type ForwardErrorMsg
- type ForwardedMsg
- type HistoryErrorMsg
- type HistoryLoadedMsg
- type MediaInfo
- type MediaType
- type Message
- type MessageSendErrorMsg
- type MessageSentMsg
- type Need2FAMsg
- type NeedAuthMsg
- type NewMessageMsg
- type OlderHistoryErrorMsg
- type OlderHistoryLoadedMsg
- type QRAuthDoneMsg
- type QRTokenMsg
- type Reaction
- type ReactionsUpdatedMsg
- type SaveFileErrorMsg
- type SaveFileMsg
- type SearchErrorMsg
- type SearchResultMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthErrorMsg ¶
type AuthErrorMsg struct {
Err error
}
type AuthorizedMsg ¶
type AuthorizedMsg struct{}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DownloadPhoto ¶ added in v0.1.1
func (*Client) DownloadToFile ¶ added in v0.1.1
DownloadToFile saves a media file (photo or document) to disk.
func (*Client) FetchDialogs ¶
func (c *Client) FetchDialogs() func() interface{}
func (*Client) FetchHistory ¶
func (*Client) FetchOlderHistory ¶ added in v0.2.0
func (*Client) ForwardMessages ¶ added in v0.2.0
func (*Client) SearchHistory ¶ added in v0.2.0
func (*Client) SendMessage ¶
func (*Client) SetProgram ¶
func (*Client) StartQRLogin ¶ added in v0.2.0
type CodeSentMsg ¶
type DialogsErrorMsg ¶
type DialogsErrorMsg struct {
Err error
}
type DialogsLoadedMsg ¶
type DialogsLoadedMsg struct {
Chats []Chat
}
type DownloadPhotoErrorMsg ¶ added in v0.1.1
type DownloadPhotoMsg ¶ added in v0.1.1
type FileSessionStorage ¶
type FileSessionStorage struct {
Path string
}
func (*FileSessionStorage) LoadSession ¶
func (s *FileSessionStorage) LoadSession(_ context.Context) ([]byte, error)
func (*FileSessionStorage) StoreSession ¶
func (s *FileSessionStorage) StoreSession(_ context.Context, data []byte) error
type ForwardErrorMsg ¶ added in v0.2.0
type ForwardErrorMsg struct {
Err error
}
type ForwardedMsg ¶ added in v0.2.0
type HistoryErrorMsg ¶
type HistoryErrorMsg struct {
Err error
}
type HistoryLoadedMsg ¶
type MediaInfo ¶ added in v0.1.1
type MediaInfo struct {
Type MediaType
Label string // Pre-formatted: "[Photo]", "[Video 0:32]", etc.
FileName string
FileSize int64
MimeType string
Width int
Height int
// Photo download fields
PhotoID int64
PhotoAccessHash int64
PhotoFileRef []byte
PhotoDCID int
PhotoThumbSize string
// Document download fields (videos, audio, files, etc.)
DocID int64
DocAccessHash int64
DocFileRef []byte
DocDCID int
}
type MessageSendErrorMsg ¶
type MessageSendErrorMsg struct {
Err error
}
type MessageSentMsg ¶
type MessageSentMsg struct {
ChatID int64
}
type Need2FAMsg ¶
type Need2FAMsg struct{}
type NeedAuthMsg ¶
type NeedAuthMsg struct{}
type NewMessageMsg ¶
type NewMessageMsg struct {
Message Message
}
type OlderHistoryErrorMsg ¶ added in v0.2.0
type OlderHistoryErrorMsg struct {
Err error
}
type OlderHistoryLoadedMsg ¶ added in v0.2.0
type QRAuthDoneMsg ¶ added in v0.2.0
type QRAuthDoneMsg struct{}
type QRTokenMsg ¶ added in v0.2.0
type QRTokenMsg struct {
URL string // tg://login?token=... to encode as QR
}
type ReactionsUpdatedMsg ¶ added in v0.2.0
type SaveFileErrorMsg ¶ added in v0.1.1
type SaveFileMsg ¶ added in v0.1.1
type SearchErrorMsg ¶ added in v0.2.0
type SearchErrorMsg struct {
Err error
}
type SearchResultMsg ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.