Versions in this module Expand all Collapse all v0 v0.0.20 Sep 5, 2026 v0.0.19 Sep 5, 2026 v0.0.18 Sep 4, 2026 Changes in this version type Client + func (c *Client) ForwardMessages(fromChatID, toChatID int64, messageIDs []int64) ([]*Message, error) + func (c *Client) GetMessages(chatID int64, messageIDs []int64) ([]*Message, error) + func (c *Client) SendRoots() []string v0.0.17 Sep 4, 2026 v0.0.16 Sep 4, 2026 v0.0.15 Sep 4, 2026 v0.0.14 Sep 4, 2026 v0.0.13 Sep 4, 2026 v0.0.12 Sep 4, 2026 v0.0.11 Sep 4, 2026 v0.0.10 Sep 3, 2026 v0.0.9 Sep 3, 2026 Changes in this version type Client + func (c *Client) LoadMoreChats(limit int) (int, error) + func (c *Client) MoreChatsToLoad() bool v0.0.8 Sep 3, 2026 v0.0.7 Sep 3, 2026 Changes in this version + const AllChatsFolderID + const MaxDialogsLimit + var ErrClientClosed = errors.New("telegram client already closed") + var ErrClientStarted = errors.New("telegram client already started") + var ErrLoginRequired = errors.New("login required: run 'telegram-mcp login' first") + var ErrQRPasswordPromptRequired = errors.New("QR login requires a 2FA password prompt") + func ReadAuthLine(in *os.File, hide bool) (string, error) + func ResolveAllowedSendPath(path string, roots ...string) (string, error) + type Animation struct + Duration int32 + File *File + FileName string + type Audio struct + Duration int32 + File *File + FileName string + Performer string + Title string + type AuthState int + const AuthStateClosed + const AuthStateReady + const AuthStateWaitCode + const AuthStateWaitPassword + const AuthStateWaitPhone + type AuthStateCallback func(AuthState, string) + type AuthStateMsg struct + State AuthState + type BasicGroupFullInfo struct + Description string + MemberCount int32 + Members []*ChatMember + type Chat struct + ID int64 + LastMessage *Message + LastReadInboxMessageID int64 + LastReadOutboxMessageID int64 + Muted bool + Order int64 + Photo *File + Pinned bool + Title string + Type ChatType + UnreadCount int32 + Username string + type ChatAction interface + type ChatActionCancel struct + type ChatActionMsg struct + Action ChatAction + ChatId int64 + UserId int64 + type ChatActionTyping struct + type ChatFolder struct + Bots bool + Channels bool + Contacts bool + Emoticon string + ExcludeArchived bool + ExcludeMuted bool + ExcludeRead bool + ExcludedChatIDs []int64 + Groups bool + ID int32 + IncludedChatIDs []int64 + NonContacts bool + PinnedChatIDs []int64 + Title string + func (f *ChatFolder) NeedsPeerFetch() bool + type ChatFoldersMsg struct + Folders []*ChatFolder + type ChatLastMessageMsg struct + ChatId int64 + LastMessage *Message + type ChatMember struct + MemberID MessageSender + Status ChatMemberStatus + type ChatMemberStatus interface + type ChatMemberStatusAdministrator struct + CustomTitle string + type ChatMemberStatusBanned struct + type ChatMemberStatusCreator struct + CustomTitle string + type ChatMemberStatusLeft struct + type ChatMemberStatusMember struct + type ChatMemberStatusRestricted struct + type ChatMuteChangedMsg struct + ChatId int64 + Muted bool + type ChatReadInboxMsg struct + ChatId int64 + LastReadInboxMessageId int64 + UnreadCount int32 + type ChatReadOutboxMsg struct + ChatId int64 + LastReadOutboxMessageId int64 + type ChatType int + const ChatTypeBasicGroup + const ChatTypeChannel + const ChatTypePrivate + const ChatTypeSupergroup + type ChatUpdateMsg struct + Chat *Chat + FromPeer bool + type Client struct + func NewClient(cfg *config.Config, authorizer *TUIAuthorizer) *Client + func NewClientAsync(cfg *config.Config, authorizer *TUIAuthorizer) *Client + func NewRPCClient(cfg *config.Config, authorizer *TUIAuthorizer) *Client + func NewRPCClientAsync(cfg *config.Config, authorizer *TUIAuthorizer) *Client + func (c *Client) Close() error + func (c *Client) CloseContext(ctx context.Context) error + func (c *Client) CreatePrivateChat(userID int64) (*Chat, error) + func (c *Client) DataDir() string + func (c *Client) DeleteMessages(chatID int64, messageIDs []int64, revoke bool) error + func (c *Client) DeviceCount() (int, error) + func (c *Client) DiscussionMessage(chatID, messageID int64) (int64, int64, error) + func (c *Client) DownloadFileSync(key string) (*File, error) + func (c *Client) EditTextMessage(chatID int64, messageID int64, text string) (*Message, error) + func (c *Client) FilesDir() string + func (c *Client) GetBasicGroupFullInfo(chatID int64) (*BasicGroupFullInfo, error) + func (c *Client) GetChat(chatID int64) (*Chat, error) + func (c *Client) GetChatFolders() ([]*ChatFolder, error) + func (c *Client) GetChatHistory(chatID, fromMessageID int64, offset, limit int32) ([]*Message, error) + func (c *Client) GetContacts() ([]*User, error) + func (c *Client) GetMe() (*User, error) + func (c *Client) GetMessage(chatID, messageID int64) (*Message, error) + func (c *Client) GetSupergroupFullInfo(chatID int64) (*SupergroupFullInfo, error) + func (c *Client) GetSupergroupMembers(chatID int64, offset, limit int32) ([]*ChatMember, error) + func (c *Client) GetUser(userID int64) (*User, error) + func (c *Client) IsReady() bool + func (c *Client) ListChats(limit int) ([]*Chat, error) + func (c *Client) LoadChats(limit int) error + func (c *Client) LoadFolderDialogs(folder *ChatFolder, already map[int64]struct{}) ([]*Chat, error) + func (c *Client) OpenChat(chatID int64) error + func (c *Client) SearchChatMedia(chatID int64, filter MediaFilter, limit int32) ([]*Message, error) + func (c *Client) SearchChatMessages(chatID int64, query string, fromMessageID int64, limit int32) ([]*Message, error) + func (c *Client) SearchChats(query string, limit int32) ([]*Chat, error) + func (c *Client) SearchMessages(query string, limit int32) ([]*Message, error) + func (c *Client) SendFileMessage(chatID int64, path, caption string, replyToMessageID int64) (*Message, error) + func (c *Client) SendPhotoMessage(chatID int64, path, caption string, replyToMessageID int64) (*Message, error) + func (c *Client) SendTextMessage(chatID int64, text string, replyToMessageID int64) (*Message, error) + func (c *Client) SetPinned(chatID, messageID int64, pinned bool) error + func (c *Client) SetReaction(chatID, messageID int64, emoji string) error + func (c *Client) Start() error + func (c *Client) ViewMessages(chatID int64, messageIDs []int64) error + func (c *Client) WaitReady() + type ClientErrorMsg struct + Err error + Terminal bool + type ClientWarningMsg struct + Text string + type Comments struct + ChatID int64 + Count int32 + Unread bool + type ConnectionState int + const ConnectionStateConnecting + const ConnectionStateDisconnected + const ConnectionStateReady + type ConnectionStateMsg struct + State ConnectionState + type Contact struct + FirstName string + LastName string + PhoneNumber string + type Document struct + File *File + FileName string + MimeType string + Thumbnail *File + type File struct + Downloaded bool + ID string + Path string + Size int64 + type FileUpdateMsg struct + File *File + type FormattedText struct + Entities []*TextEntity + Text string + func PreviewMarkdown(text string) *FormattedText + type Listener struct + func NewListener(client *Client, program *tea.Program) (*Listener, error) + func (l *Listener) Start() error + type Location struct + Latitude float64 + Longitude float64 + type MediaFilter int + const MediaFilterFiles + const MediaFilterLinks + const MediaFilterPhotos + const MediaFilterPinned + func (f MediaFilter) String() string + type Message struct + ChatID int64 + Comments *Comments + Content MessageContent + Date int32 + EditDate int32 + ID int64 + IsChannelPost bool + IsForwarded bool + IsOutgoing bool + IsPinned bool + Reactions []*Reaction + ReplyToMessageID int64 + SenderID MessageSender + type MessageAnimation struct + Animation *Animation + Caption *FormattedText + type MessageAudio struct + Audio *Audio + Caption *FormattedText + type MessageChatAddMembers struct + type MessageChatChangePhoto struct + type MessageChatChangeTitle struct + Title string + type MessageChatDeleteMember struct + type MessageChatJoinByLink struct + type MessageContact struct + Contact *Contact + type MessageContent interface + type MessageDeletedMsg struct + ChatId int64 + MessageIds []int64 + type MessageDocument struct + Caption *FormattedText + Document *Document + type MessageEditedMsg struct + ChatId int64 + MessageId int64 + type MessageLocation struct + Location *Location + type MessagePhoto struct + Caption *FormattedText + Photo *Photo + type MessagePinMessage struct + type MessagePoll struct + Poll *Poll + type MessageSendFailedMsg struct + ErrorCode int32 + ErrorMessage string + Message *Message + OldMessageId int64 + type MessageSendSucceededMsg struct + Message *Message + OldMessageId int64 + type MessageSender interface + type MessageSenderChat struct + ChatID int64 + type MessageSenderUser struct + UserID int64 + type MessageSticker struct + Sticker *Sticker + type MessageText struct + Text *FormattedText + WebPage *WebPage + type MessageUnsupported struct + Type string + type MessageVideo struct + Caption *FormattedText + Video *Video + type MessageVideoNote struct + VideoNote *VideoNote + type MessageVoiceNote struct + Caption *FormattedText + VoiceNote *VoiceNote + type NewMessageMsg struct + Message *Message + type Photo struct + ID int64 + Sizes []*PhotoSize + type PhotoSize struct + File *File + Height int + Type string + Width int + type Poll struct + CloseDate int32 + IsAnonymous bool + IsClosed bool + IsQuiz bool + MultipleChoice bool + Options []*PollOption + Question string + ResultsKnown bool + TotalVoterCount int32 + type PollOption struct + Chosen bool + Correct bool + Percent int32 + Text string + VoterCount int32 + type QRLoginOptions struct + PasswordPrompt func(ctx context.Context, retry bool) ([]byte, error) + ShowQRCode func(context.Context, QRLoginToken) error + type QRLoginToken struct + ExpiresAt time.Time + URL string + type Reaction struct + Chosen bool + Count int32 + CustomEmojiID int64 + Emoji string + type Sticker struct + Emoji string + File *File + type SupergroupFullInfo struct + Description string + MemberCount int32 + type TUIAuthorizer struct + NonInteractive bool + func NewTUIAuthorizer(cfg *config.Config) *TUIAuthorizer + func (a *TUIAuthorizer) AcceptTermsOfService(ctx context.Context, _ tg.HelpTermsOfService) error + func (a *TUIAuthorizer) Close() + func (a *TUIAuthorizer) Code(ctx context.Context, _ *tg.AuthSentCode) (string, error) + func (a *TUIAuthorizer) Password(ctx context.Context) (string, error) + func (a *TUIAuthorizer) Phone(ctx context.Context) (string, error) + func (a *TUIAuthorizer) SetErrorCallback(cb func(error)) + func (a *TUIAuthorizer) SetStateCallback(cb AuthStateCallback) + func (a *TUIAuthorizer) SignUp(ctx context.Context) (auth.UserInfo, error) + func (a *TUIAuthorizer) SubmitCode(code string) + func (a *TUIAuthorizer) SubmitPassword(password string) + func (a *TUIAuthorizer) SubmitPhone(phone string) + type TextEntity struct + Length int32 + Offset int32 + Type TextEntityType + type TextEntityType interface + type TextEntityTypeBlockQuote struct + type TextEntityTypeBold struct + type TextEntityTypeBotCommand struct + type TextEntityTypeCode struct + type TextEntityTypeEmailAddress struct + type TextEntityTypeHashtag struct + type TextEntityTypeItalic struct + type TextEntityTypeMention struct + type TextEntityTypeMentionName struct + UserID int64 + type TextEntityTypePre struct + type TextEntityTypePreCode struct + Language string + type TextEntityTypeSpoiler struct + type TextEntityTypeStrikethrough struct + type TextEntityTypeTextURL struct + URL string + type TextEntityTypeURL struct + type TextEntityTypeUnderline struct + type UnreadCountMsg struct + UnreadCount int32 + UnreadUnmutedCount int32 + type User struct + FirstName string + ID int64 + IsBot bool + LastName string + PhoneNumber string + Status UserStatus + Username string + func LoginWithQR(ctx context.Context, cfg *config.Config, opts QRLoginOptions) (*User, error) + type UserStatus interface + type UserStatusEmpty struct + type UserStatusLastMonth struct + type UserStatusLastWeek struct + type UserStatusOffline struct + WasOnline int32 + type UserStatusOnline struct + Expires int32 + type UserStatusRecently struct + type Video struct + Duration int32 + File *File + FileName string + Height int + Thumbnail *File + Width int + type VideoNote struct + Duration int32 + File *File + type VoiceNote struct + Duration int32 + File *File + Waveform []byte + type WebPage struct + Description string + DisplayURL string + SiteName string + Title string + URL string