Documentation
¶
Index ¶
- type Client
- func (c *Client) Connect(resource string) error
- func (c *Client) Disconnect(resource string, quit bool) bool
- func (c *Client) DownloadFile(id int32, priority int32, synchronous bool) (*client.File, error)
- func (c *Client) GetContactByID(id int64, chat *client.Chat) (*client.Chat, *client.User, error)
- func (c *Client) GetContactByUsername(username string) (*client.Chat, *client.User, error)
- func (c *Client) LastSeenStatus(timestamp int64) string
- func (c *Client) Online() bool
- func (c *Client) ProcessChatCommand(chatID int64, cmdline string) (string, bool)
- func (c *Client) ProcessOutgoingMessage(chatID int64, text string, returnJid string) client.InputMessageContent
- func (c *Client) ProcessStatusUpdate(chatID int64, status string, show string, oldArgs ...args.V) error
- func (c *Client) ProcessTransportCommand(cmdline string, resource string) string
- func (c *Client) StatusesRange() chan *cache.Status
- type DelayedStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Session *persistence.Session DelayedStatuses map[int64]*DelayedStatus DelayedStatusesLock sync.Mutex // contains filtered or unexported fields }
Client stores the metadata for lazily invoked TDlib instance
func NewClient ¶
func NewClient(conf config.TelegramConfig, jid string, component *xmpp.Component, session *persistence.Session) (*Client, error)
NewClient instantiates a Telegram App
func (*Client) Disconnect ¶
Disconnect drops TDlib connection and returns the flag indicating if disconnecting is permitted
func (*Client) DownloadFile ¶
DownloadFile actually obtains a file by id given by TDlib
func (*Client) GetContactByID ¶
GetContactByID gets user and chat information from cache (or tries to retrieve it, if missing)
func (*Client) GetContactByUsername ¶
GetContactByUsername resolves username to user id retrieves user and chat information
func (*Client) LastSeenStatus ¶
LastSeenStatus formats a timestamp to a "Last seen at" string
func (*Client) ProcessChatCommand ¶
ProcessChatCommand executes a command sent in a mapped chat and returns a response and the status of command support
func (*Client) ProcessOutgoingMessage ¶
func (c *Client) ProcessOutgoingMessage(chatID int64, text string, returnJid string) client.InputMessageContent
ProcessOutgoingMessage executes commands or sends messages to mapped chats
func (*Client) ProcessStatusUpdate ¶
func (c *Client) ProcessStatusUpdate(chatID int64, status string, show string, oldArgs ...args.V) error
ProcessStatusUpdate sets contact status
func (*Client) ProcessTransportCommand ¶
ProcessTransportCommand executes a command sent directly to the component and returns a response
func (*Client) StatusesRange ¶
StatusesRange proxies the following function from unexported cache
type DelayedStatus ¶
DelayedStatus describes an online status expiring on timeout