Skip to content

Commit

Permalink
add audio file
Browse files Browse the repository at this point in the history
  • Loading branch information
csznet committed Oct 10, 2023
1 parent 9f6f41a commit 7275af2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ type Message struct {
Date int64 `json:"date"`
Document Document `json:"document"`
Video Video `json:"video`
Audio Audio `json:"audio"`
}
type Audio struct {
Duration int `json:duration`
FileID string `json:"file_id"`
FileUniqueID string `json:"file_unique_id"`
FileName string `json:"file_name"`
MimeType string `json:"mime_type"`
FileSize int `json:"file_size"`
}
type Video struct {
Duration int `json:"duration"`
Expand Down
4 changes: 3 additions & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ func UpDocument(fileData tgbotapi.FileBytes) string {
var resp string
if msg.Document.FileID != "" {
resp = msg.Document.FileID
} else {
} else if msg.Audio.FileID != "" {
resp = msg.Audio.FileID
} else if msg.Video.FileID != "" {
resp = msg.Video.FileID
}
return resp
Expand Down

0 comments on commit 7275af2

Please sign in to comment.