| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- package telegram
- import (
- "fmt"
- "time"
- )
- // Account TG 账号信息
- type Account struct {
- Phone string
- SessionFile string
- AppID int
- AppHash string
- Device string // DeviceModel e.g. "Xiaomi Mix 4" — empty = gotd default
- AppVersion string // e.g. "12.0.0 (6163)"
- SystemVersion string // e.g. "Android 13 (33)" — mapped from DB.sdk
- LangPack string // e.g. "android"
- LangCode string // e.g. "en"
- SystemLangCode string // e.g. "en-US"
- }
- // ChannelInfo 频道基本信息
- type ChannelInfo struct {
- Username string
- Title string
- MemberCount int
- About string
- IsChannel bool
- IsGroup bool
- }
- // Message TG 消息
- type Message struct {
- ID int
- Text string
- ForwardFromChannel string // forward 来源频道用户名
- Links []string // 消息中的 t.me 链接
- IsService bool // 系统消息
- }
- // UserInfo TG 用户信息(验证商户时用)
- type UserInfo struct {
- ID int64
- Username string
- FirstName string
- LastName string
- IsBot bool
- IsPremium bool
- LastOnline *time.Time
- IsChannel bool
- IsGroup bool
- Exists bool // false 表示不存在/已注销
- }
- // GroupParticipant 群成员信息
- type GroupParticipant struct {
- ID int64 `json:"id"`
- Username string `json:"username"`
- FirstName string `json:"first_name"`
- LastName string `json:"last_name"`
- IsBot bool `json:"is_bot"`
- IsPremium bool `json:"is_premium"`
- }
- // FloodWaitError FloodWait 错误,包含等待时长
- type FloodWaitError struct {
- Seconds int
- }
- func (e *FloodWaitError) Error() string {
- return fmt.Sprintf("FloodWait: %d seconds", e.Seconds)
- }
|