feat: implement telegram bot plugin (#1740)

This commit is contained in:
Athurg Gooth
2023-05-26 09:43:51 +08:00
committed by GitHub
parent a07d11e820
commit 1282fe732e
23 changed files with 577 additions and 15 deletions

View File

@@ -0,0 +1,24 @@
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
}