Documentation
¶
Index ¶
- type Addr
- type Chat
- type ChatType
- type Conn
- func (c *Conn) CompleteLoginWith2FAPassword(password []byte) error
- func (c *Conn) CompleteLoginWithCode(code string) error
- func (c *Conn) Fail(err error)
- func (c *Conn) HandleUnknownReply(r tl.Object) error
- func (c *Conn) LoadChats(contacts *ContactList) error
- func (c *Conn) LoadHistory(contacts *ContactList, chat *Chat, limit int) error
- func (c *Conn) LoginState() LoginState
- func (c *Conn) Run() error
- func (c *Conn) Send(o tl.Object) (tl.Object, error)
- func (c *Conn) Shutdown()
- func (c *Conn) StartLogin(phoneNumber string) error
- func (c *Conn) SwitchToDC(dc int)
- type ContactList
- type DCState
- type Delegate
- type LoginState
- type Message
- type MessageList
- type MessageType
- type Options
- type State
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chat ¶
type Chat struct {
Type ChatType
// user ID, chat ID or channnel ID
ID int
User *User
// valid for users and channels
AccessHash uint64
// valid for chats and channels
Title string
Messages *MessageList
// valid for channels and users
Username string
}
func (*Chat) TitleOrName ¶
type Conn ¶
type Conn struct {
Options
// contains filtered or unexported fields
}
func (*Conn) CompleteLoginWith2FAPassword ¶
func (*Conn) CompleteLoginWithCode ¶
func (*Conn) LoadChats ¶
func (c *Conn) LoadChats(contacts *ContactList) error
func (*Conn) LoadHistory ¶
func (c *Conn) LoadHistory(contacts *ContactList, chat *Chat, limit int) error
func (*Conn) LoginState ¶
func (c *Conn) LoginState() LoginState
func (*Conn) StartLogin ¶
func (*Conn) SwitchToDC ¶
type ContactList ¶
type ContactList struct {
Self *User
Chats []*Chat
SelfChat *Chat
Users map[int]*User
UserChats map[int]*Chat
ChatChats map[int]*Chat
ChannelChats map[int]*Chat
}
func NewContactList ¶
func NewContactList() *ContactList
func (*ContactList) FindChatByPeer ¶
func (contacts *ContactList) FindChatByPeer(peer mtproto.TLPeerType) *Chat
type DCState ¶
type DCState struct {
ID int
PrimaryAddr Addr
Auth mtproto.AuthResult
FramerState mtproto.FramerState
}
type Delegate ¶
type Delegate interface {
HandleConnectionReady()
HandleStateChanged(newState *State)
}
type LoginState ¶
type LoginState int
const ( LoggedOut LoginState = iota LoggedIn WaitingForCode WaitingFor2FA )
type MessageList ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
telegram-experiment
command
|
|
|
telegram-exporter
command
|
|
|
Infinite Garble Extension (IGE) mode.
|
Infinite Garble Extension (IGE) mode. |
|
PQ factorization derived from org.telegram.mtproto.secure.pq.PQLopatin of github.com/ex3ndr/telegram-mt
|
PQ factorization derived from org.telegram.mtproto.secure.pq.PQLopatin of github.com/ex3ndr/telegram-mt |
|
Code generated by tlc (github.com/andreyvit/telegramapi/tl/cmd/tlc).
|
Code generated by tlc (github.com/andreyvit/telegramapi/tl/cmd/tlc). |
|
cmd/tlc
command
|
|
Click to show internal directories.
Click to hide internal directories.