config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(cfg *Config) error

Save writes the config to the default config path.

Types

type Config

type Config struct {
	Telegram      TelegramConfig     `toml:"telegram"`
	Storage       StorageConfig      `toml:"storage"`
	UI            UIConfig           `toml:"ui"`
	Media         MediaConfig        `toml:"media"`
	Notifications NotificationConfig `toml:"notifications"`
	Keys          KeyConfig          `toml:"keys"`
}

func Load

func Load() (*Config, error)

type KeyConfig

type KeyConfig struct {
	Quit          string `toml:"quit"`
	FocusChatList string `toml:"focus_chat_list"`
	FocusChatView string `toml:"focus_chat_view"`
	FocusComposer string `toml:"focus_composer"`
	Search        string `toml:"search"`
	Contacts      string `toml:"contacts"`
	NextChat      string `toml:"next_chat"`
	PrevChat      string `toml:"prev_chat"`
	Reply         string `toml:"reply"`
	EditMessage   string `toml:"edit_message"`
	DeleteMessage string `toml:"delete_message"`
	Forward       string `toml:"forward"`
	ScrollUp      string `toml:"scroll_up"`
	ScrollDown    string `toml:"scroll_down"`
	PageUp        string `toml:"page_up"`
	PageDown      string `toml:"page_down"`
}

type MediaConfig

type MediaConfig struct {
	ImageProtocol       string `toml:"image_protocol"`
	MaxImageWidth       int    `toml:"max_image_width"`
	MaxImageHeight      int    `toml:"max_image_height"`
	VoicePlayer         string `toml:"voice_player"`
	VideoPlayer         string `toml:"video_player"`
	AutoDownloadPhotos  bool   `toml:"auto_download_photos"`
	AutoDownloadVoice   bool   `toml:"auto_download_voice"`
	AutoDownloadLimitMB int    `toml:"auto_download_limit_mb"`
}

type NotificationConfig

type NotificationConfig struct {
	Enabled     bool `toml:"enabled"`
	Sound       bool `toml:"sound"`
	ShowPreview bool `toml:"show_preview"`
}

type StorageConfig

type StorageConfig struct {
	SessionFile string `toml:"session_file"`
	FilesDir    string `toml:"files_dir"`
}

type TelegramConfig

type TelegramConfig struct {
	APIID   int32  `toml:"api_id"`
	APIHash string `toml:"api_hash"`
	Phone   string `toml:"phone"`
}

type UIConfig

type UIConfig struct {
	Theme           string `toml:"theme"`
	ChatListWidth   int    `toml:"chat_list_width"`
	ShowAvatars     bool   `toml:"show_avatars"`
	TimestampFormat string `toml:"timestamp_format"`
	DateFormat      string `toml:"date_format"`
}

Jump to

Keyboard shortcuts

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