Documentation
¶
Index ¶
- Constants
- type Auth
- type ChatFilter
- type ClientCallLeave
- type ClientCallMuteAll
- type ClientCallRecord
- type ClientCallReject
- type ClientCallSound
- type ClientCallTrickle
- type Err
- type Group
- type GroupMember
- type Message
- type MessageFilter
- type MessageUpdate
- type Paginator
- type Resp
- type SmsCode
- type Task
Constants ¶
View Source
const ( Ok = Err("OK") EmptyToken = Err("EMPTY_TOKEN") EmptySession = Err("EMPTY_SESSION") InvalidToken = Err("INVALID_TOKEN") AccessDenied = Err("ACCESS_DENIED") NotFound = Err("NOT_FOUND") RateLimit = Err("RATE_LIMIT") InternalServerError = Err("INTERNAL_SERVER_ERROR") InvalidMethod = Err("INVALID_METHOD") InvalidData = Err("INVALID_DATA") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct {
Token string `json:"token,omitempty"`
Me tdproto.UserWithMe `json:"me"`
}
type ChatFilter ¶ added in v1.12.1
type ChatFilter struct {
Paginator
// ?unread_first=true|false (default: false)
UnreadFirst string `schema:"unread_first"`
// ?unread_only=true|false (default: false)
UnreadOnly string `schema:"unread_only"`
// ?hidden_only=true|false (default: false)
HiddenOnly string `schema:"hidden_only"`
// ?chat_type=task,group,direct|any (default: any)
ChatType string `schema:"chat_type"`
// ?mix_contacts=true|false (default: false)
MixContacts string `schema:"mix_contacts"`
// ?sort = [ "group_chat_display_name" | "-group_chat_display_name" | "last_message" | "-last_message" ]
Sort string `schema:"sort"`
// ?q=search-text
Q string `schema:"q"`
}
type ClientCallLeave ¶ added in v1.4.0
type ClientCallMuteAll ¶ added in v1.4.0
type ClientCallRecord ¶ added in v1.4.0
type ClientCallReject ¶ added in v1.4.0
type ClientCallSound ¶ added in v1.4.0
type ClientCallTrickle ¶ added in v1.4.0
type Group ¶ added in v1.11.1
type Group struct {
// Group title
DisplayName string `json:"display_name"`
// Group description, optiopnal
Description string `json:"description"`
// Readonly for non-admins group chat (Like Channels in Telegram bug switchable)
ReadonlyForMembers bool `json:"readonly_for_members"`
// Can other team member see this group
Public bool `json:"public"`
// Any new team member will be added to this group chat
DefaultForAll bool `json:"default_for_all"`
// Delete messages in this chat in seconds. Experemental function
AutocleanupAge *int `json:"autocleanup_age"`
// Pinned message for this group
PinnedMessage string `json:"pinned_message"`
// Group members list
Members []GroupMember `json:"members"`
// Deprecated
Section string `json:"section"`
}
type GroupMember ¶ added in v1.11.1
type GroupMember struct {
// Member jid
Jid tdproto.JID `json:"jid"`
// Status: member or admin
Status tdproto.GroupStatus `json:"status,omitempty"`
}
type Message ¶ added in v1.2.8
type Message struct {
// Message type
Type tdproto.Mediatype `json:"type"`
// Message text
Text string `json:"text"`
// Message id
MessageUid string `json:"message_id,omitempty"`
// Message attachments
Uploads []string `json:"uploads,omitempty"`
// Backward compatibility mode
OldStyleAttachment bool `json:"old_style_attachment,omitempty"`
MessageUpdate
}
type MessageFilter ¶ added in v1.12.0
type MessageFilter struct {
// ?chat=jid,jid
Chat string `schema:"chat"`
// ?chat_type=task,group,direct|any (default: any)
ChatType string `schema:"chat_type"`
// ?sender=jid,jid
Sender string `schema:"sender"`
// ?has_upload=true|false|any (default: any)
HasUpload string `schema:"has_upload"`
// ?text=substr
Text string `schema:"text"`
// ?type=image,video,plain,file
Type string `schema:"type"`
// ?important=true|any
Important string `schema:"important"`
// ?date_from=dt (include)
DateFrom string `schema:"date_from"`
// ?date_to=dt
DateTo string `schema:"date_to"`
// ?include_deleted=true|false (default: false)
IncludeDeleted string `schema:"include_deleted"`
// ?gentime_from=
GentimeFrom string `schema:"gentime_from"`
// ?exact=msgId
Exact string `schema:"exact"`
// ?unread=(true|false)
Unread string `schema:"unread"`
// ?old_from=msgId (exclude msgId)
OldFrom string `schema:"old_from"`
// ?new_from=msgId (exclude msgId)
NewFrom string `schema:"new_from"`
// ?old_from_inc=msgId (include msgId)
OldFromInc string `schema:"old_from_inc"`
// ?new_from_inc=msgId (include msgId)
NewFromInc string `schema:"new_from_inc"`
// ?around=msgId (include msgId)
Around string `schema:"around"`
}
type MessageUpdate ¶ added in v1.2.8
type Task ¶ added in v1.3.1
type Task struct {
CustomColorIndex *uint16 `json:"custom_color_index,omitempty"`
Description string `json:"description,omitempty"`
Tags []string `json:"tags,omitempty"`
SectionUid string `json:"section,omitempty"`
Observers []tdproto.JID `json:"observers,omitempty"`
Items []string `json:"items,omitempty"`
Assignee tdproto.JID `json:"assignee,omitempty"`
Deadline string `json:"deadline,omitempty"`
Public bool `json:"public,omitempty"`
RemindAt string `json:"remind_at,omitempty"`
TaskStatus string `json:"task_status,omitempty"`
Importance *int `json:"importance,omitempty"`
Urgency *int `json:"urgency,omitempty"`
Complexity *int `json:"complexity,omitempty"`
SpentTime *int `json:"spent_time,omitempty"`
LinkedMessages []string `json:"linked_messages,omitempty"` // TODO: Message object
Uploads []tdproto.Upload `json:"uploads,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.