memos/plugin/telegram/message.go
2023-05-26 09:43:51 +08:00

25 lines
584 B
Go

package telegram
type Message struct {
MessageID int `json:"message_id"`
From User `json:"from"`
Date int `json:"date"`
Text *string `json:"text"`
Chat *Chat `json:"chat"`
MediaGroupID *string `json:"media_group_id"`
Photo []PhotoSize `json:"photo"`
Caption *string `json:"caption"`
}
func (m Message) GetMaxPhotoFileID() string {
var fileSize int64
var photoSize PhotoSize
for _, p := range m.Photo {
if p.FileSize > fileSize {
photoSize = p
}
}
return photoSize.FileID
}