tdapi

package
v1.25.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2021 License: MIT Imports: 1 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Unknown2fa     = "unknown"
	Unconfirmed2fa = "unconfirmed"
	Confirmed2fa   = "confirmed"
	Declined2fa    = "declined"
)

RecoveryStatus:

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")
	NotModified         = Err("NOT_MODIFIED")
	Gone                = Err("GONE")
	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"`
	Required2fa bool               `json:"required2fa"`
	Recovery2fa bool               `json:"recovery2fa"`
	Method2fa   string             `json:"method2fa"`
}

type Auth2faForm added in v1.21.7

type Auth2faForm struct {
	// contains filtered or unexported fields
}

type Auth2faMailRecovery added in v1.23.3

type Auth2faMailRecovery struct {
	CodeValidUntil string `json:"code_valid_until"`
	NextCodeAt     string `json:"next_code_at"`
	CodeLength     int    `json:"code_length"`
	Email          string `json:"email"`
}

type Auth2faSettingsMailValidation added in v1.23.3

type Auth2faSettingsMailValidation struct {
	Enabled        bool   `json:"enabled"`
	RecoveryStatus string `json:"recovery_status"`

	CodeValidUntil string `json:"code_valid_until"`
	NextCodeAt     string `json:"next_code_at"`
	CodeLength     int    `json:"code_length"`
}

type Auth2faSettingsResponse added in v1.21.7

type Auth2faSettingsResponse struct {
	Enabled        bool   `json:"enabled"`
	RecoveryStatus string `json:"recovery_status"`
}

type AuthCheckCode2faForm added in v1.23.3

type AuthCheckCode2faForm struct {
	// contains filtered or unexported fields
}

type AuthPasswordRecovery2faForm added in v1.23.3

type AuthPasswordRecovery2faForm struct {
	// contains filtered or unexported fields
}

type AuthToken2faForm added in v1.23.3

type AuthToken2faForm struct {
	// contains filtered or unexported fields
}

type ChatFilter added in v1.12.1

type ChatFilter struct {
	UserParams
	Paginator

	// ?unread_first=true|false (default: false)
	UnreadFirst string `schema:"unread_first"`

	// ?unread_only=true|false (default: false)
	UnreadOnly string `schema:"unread_only"`

	// ?hidden=true|false|any (default: false)
	Hidden string `schema:"hidden"`

	// ?feed=true|false|any (default: any)
	Feed string `schema:"feed"`

	// ?has_activity=true|false|any (default: any)
	HasActivity string `schema:"has_activity"`

	// ?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"`

	// gentime great than
	GentimeGT int64 `schema:"gentime_gt"`

	// deprecated
	HiddenOnly string `schema:"hidden_only"`

	// deprecated: use ?has_activity=
	HasMessages string `schema:"has_messages"`
}

type ClientCallLeave added in v1.4.0

type ClientCallLeave struct {
	Jid    tdproto.JID `json:"jid"`
	Reason string      `json:"reason"`
}

type ClientCallMuteAll added in v1.4.0

type ClientCallMuteAll struct {
	Jid tdproto.JID `json:"jid"`
}

type ClientCallRecord added in v1.4.0

type ClientCallRecord struct {
	Jid         tdproto.JID `json:"jid"`
	Uid         string      `json:"uid"`
	Audiorecord bool        `json:"audiorecord,omitempty"`
}

type ClientCallReject added in v1.4.0

type ClientCallReject struct {
	Jid    tdproto.JID `json:"jid"`
	Reason string      `json:"reason"`
}

type ClientCallSound added in v1.4.0

type ClientCallSound struct {
	Jid   tdproto.JID `json:"jid"`
	Muted bool        `json:"muted"`
}

type ClientCallTrickle added in v1.4.0

type ClientCallTrickle struct {
	Jid           tdproto.JID `json:"jid"`
	Candidate     string      `json:"candidate"`
	SdpMid        string      `json:"sdp_mid"`
	SdpMlineIndex int         `json:"sdp_mline_index"`
}

type ConfirmMail2faForm added in v1.23.3

type ConfirmMail2faForm struct {
	// contains filtered or unexported fields
}

type Create2faPasswordForm added in v1.23.3

type Create2faPasswordForm struct {
	// contains filtered or unexported fields
}

type Err

type Err string

func (Err) Error

func (e Err) Error() string

func (Err) StatusCode

func (e Err) StatusCode() int

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 Internal2faPasswordForm added in v1.23.3

type Internal2faPasswordForm struct {
	// contains filtered or unexported fields
}

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 {
	UserParams
	Paginator

	// ?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 tdproto.Mediatype `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 MessageUpdate struct {
	// Important flag. Not required. Default: false
	Important bool `json:"important,omitempty"`

	// Disable links preview generation. Not required. Default: false
	Nopreview bool `json:"nopreview,omitempty"`

	// Draft message, send later
	SendAt string `json:"send_at,omitempty"`
}

type Paginator added in v1.12.2

type Paginator struct {
	Limit  int `schema:"limit"`
	Offset int `schema:"offset"`
}

type Resp

type Resp struct {
	DebugTime string            `json:"_time,omitempty"`
	Ok        bool              `json:"ok"`
	Result    interface{}       `json:"result,omitempty"`
	Error     Err               `json:"error,omitempty"`
	Details   map[string]string `json:"details,omitempty"`
}

type SendMail2faConfirmForm added in v1.23.3

type SendMail2faConfirmForm struct {
	// contains filtered or unexported fields
}

type SmsCode

type SmsCode struct {
	Phone          string `json:"phone"`
	CodeValidUntil string `json:"code_valid_until"`
	NextCodeAt     string `json:"next_code_at"`
	CodeLength     int    `json:"code_length"`
}

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"` // TODO: rename to "followers"
	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          []string      `json:"uploads,omitempty"`
}

type TaskFilter added in v1.13.3

type TaskFilter struct {
	UserParams
	Paginator

	//* ?sort = [ "created" | "-created" | "last_message" | "-last_message" | "deadline" | "-deadline" ]
	Sort string `schema:"sort"`

	//* ?task_status = ["new" | "done" ]
	TaskStatus string `schema:"task_status"`

	//* ?num=num1,num2,num3...
	Num string `schema:"num"`

	//* ?observer=jid,jid   // TODO: rename to ?follower=
	Observer string `schema:"observer"`

	//* ?member=jid,jid
	Member string `schema:"member"`

	//* ?assignee=jid,jid
	Assignee string `schema:"assignee"`

	//* ?owner=jid,jid
	Owner string `schema:"owner"`

	//* ?section=[ uid,uid... | "-" ]
	Section string `schema:"section"`

	//* ?tag=[ tag,tag,tag... | "-" ]
	Tag string `schema:"tag"`

	//* ?q=
	Q string `schema:"q"`

	//* ?public=true|false
	Public string `schema:"public"`

	//* ?deadline_gte=<isodate>
	DeadlineGTE string `schema:"deadline_gte"`

	//* ?deadline_lte=<isodate>
	DeadlineLTE string `schema:"deadline_lte"`

	//* ?done_gte=<isodate>
	DoneGTE string `schema:"done_gte"`

	//* ?done_lte=<isodate>
	DoneLTE string `schema:"done_lte"`

	//* ?created_gte=<isodate>
	CreatedGTE string `schema:"created_gte"`

	//* ?created_lte=<isodate>
	CreatedLTE string `schema:"created_lte"`

	//* ?short=true|false
	Short string `schema:"short"`

	// gentime great than group/chat
	GentimeGT int64 `schema:"gentime_gt"`
}

type Update2faPasswordForm added in v1.23.3

type Update2faPasswordForm struct {
	// contains filtered or unexported fields
}

type UserParams added in v1.12.3

type UserParams struct {
	Lang     string `schema:"lang"`
	Timezone string `schema:"timezone"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL