tljson

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tljson contains some helpers to work with JSONValue class.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(d *jx.Decoder) (tg.JSONValueClass, error)

Decode decodes JSON and converts it to tg.JSONValueClass.

func Encode

func Encode(obj tg.JSONValueClass, e *jx.Encoder)

Encode writes given value to Encoder.

Types

type AppConfig

type AppConfig struct {
	Test int `json:"test"`
	// Animated emojis and animated dice should be scaled by this factor before being shown to the user.
	EmojiesAnimatedZoom float64 `json:"emojies_animated_zoom"`
	// A list of supported animated dice stickers.
	EmojiesSendDice []string `json:"emojies_send_dice"`
	// For animated dice emojis other than the basic 🎲, indicates the winning dice value
	// and the final frame of the animated sticker, at which to show the fireworks.
	EmojiesSendDiceSuccess map[string]EmojiSendDiceSuccess `json:"emojies_send_dice_success"`
	// A map of soundbites to be played when the user clicks on the specified animated emoji.
	//
	// The file reference field should be base64-decoded before downloading the file.
	EmojiesSounds map[string]EmojiSound `json:"emojies_sounds"`
	// Specifies the name of the service providing GIF search through gif_search_username.
	GIFSearchBranding string `json:"gif_search_branding"`
	// Specifies a list of emojies that should be suggested as search term in a bar above the GIF search box.
	GIFSearchEmojies []string `json:"gif_search_emojies"`
	// Specifies that the app should not display local sticker suggestions
	// for emojis at all and just use the result of messages.getStickers.
	StickersEmojiSuggestOnlyAPI bool `json:"stickers_emoji_suggest_only_api"`
	// Specifies the validity period of the local cache of messages.getStickers,
	// also relevant when generating the pagination hash when invoking the method.
	StickersEmojiCacheTime        int    `json:"stickers_emoji_cache_time"`
	GroupCallVideoParticipantsMax int    `json:"groupcall_video_participants_max"`
	YoutubePIP                    string `json:"youtube_pip"`
	// Whether the Settings->Devices menu should show an option to scan a QR login code.
	QRLoginCamera bool `json:"qr_login_camera"`
	// Whether the login screen should show a QR code login option, possibly
	// as default login method ("disabled", "primary" or "secondary")
	QRLoginCode string `json:"qr_login_code"`
	// Whether clients should show an option for managing dialog filters AKA folders.
	DialogFiltersEnabled bool `json:"dialog_filters_enabled"`
	// Whether clients should actively show a tooltip, inviting the user to configure dialog filters AKA folders.
	//
	// Typically, this happens when the chat list is long enough to start getting cluttered.
	DialogFiltersTooltip bool `json:"dialog_filters_tooltip"`
	// Whether clients can invoke account.setGlobalPrivacySettings
	// with globalPrivacySettings.archive_and_mute_new_noncontact_peers = boolTrue,
	// to automatically archive and mute new incoming chats from non-contacts.
	AutoArchiveSettingAvailable bool `json:"autoarchive_setting_available"`
	// Contains a list of suggestions that should be actively shown as a tooltip to the user.
	PendingSuggestions []string `json:"pending_suggestions"`
	// Autologin token.
	//
	// See https://core.telegram.org/api/url-authorization#link-url-authorization.
	AutologinToken string `json:"autologin_token"`
	// A list of Telegram domains that support automatic login with no user confirmation.
	//
	// See https://core.telegram.org/api/url-authorization#link-url-authorization.
	AutologinDomains []string `json:"autologin_domains"`
	// A list of domains that support automatic login with manual user confirmation.
	//
	// See https://core.telegram.org/api/url-authorization#link-url-authorization.
	URLAuthDomains []string `json:"url_auth_domains"`
	// Contains a set of recommended codec parameters for round videos.
	RoundVideoEncoding RoundVideoEncoding `json:"round_video_encoding"`
	// To protect user privacy, read receipts are only stored for
	// chat_read_mark_expire_period seconds after the message was sent.
	ChatReadMarkExpirePeriod int `json:"chat_read_mark_expire_period"`
	// Per-user read receipts, fetchable using messages.getMessageReadParticipants
	// will be available in groups with less than chat_read_mark_size_threshold participants.
	ChatReadMarkSizeThreshold int `json:"chat_read_mark_size_threshold"`

	// Unparsed is map of unknown unparsed fields.
	Unparsed map[string]tg.JSONValueClass
}

AppConfig represents app config structure.

See https://core.telegram.org/api/config#client-configuration.

func (*AppConfig) DecodeJSON

func (e *AppConfig) DecodeJSON(d *jx.Decoder) error

DecodeJSON decodes AppConfig.

func (*AppConfig) DecodeJSONValue

func (e *AppConfig) DecodeJSONValue(val tg.JSONValueClass) error

DecodeJSONValue decodes AppConfig from tg.JSONValueClass.

type EmojiSendDiceSuccess

type EmojiSendDiceSuccess struct {
	Value      int `json:"value"`
	FrameStart int `json:"frame_start"`
}

EmojiSendDiceSuccess represents the winning dice value and the final frame of the animated sticker.

See https://core.telegram.org/api/dice.

func (*EmojiSendDiceSuccess) DecodeJSON

func (e *EmojiSendDiceSuccess) DecodeJSON(d *jx.Decoder) error

DecodeJSON decodes EmojiSendDiceSuccess.

type EmojiSound

type EmojiSound struct {
	ID            int64  `json:"id"`
	AccessHash    int64  `json:"access_hash"`
	FileReference []byte `json:"file_reference_base64"`
}

EmojiSound represents emoji sound file location.

See https://core.telegram.org/api/animated-emojis#emojis-with-sounds.

func (*EmojiSound) DecodeJSON

func (e *EmojiSound) DecodeJSON(d *jx.Decoder) error

DecodeJSON decodes EmojiSound.

type RoundVideoEncoding

type RoundVideoEncoding struct {
	Diameter     int `json:"diameter"`
	VideoBitrate int `json:"video_bitrate"`
	AudioBitrate int `json:"audio_bitrate"`
	MaxSize      int `json:"max_size"`
}

RoundVideoEncoding represents a set of recommended codec parameters for round videos.

func (*RoundVideoEncoding) DecodeJSON

func (e *RoundVideoEncoding) DecodeJSON(d *jx.Decoder) error

DecodeJSON decodes RoundVideoEncoding.

Jump to

Keyboard shortcuts

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