mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-05-11 22:39:41 +08:00
feat: improve file handling by generating default file names and adding mime type detection
This commit is contained in:
@@ -18,7 +18,6 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
ErrEmptyFileName = errors.New("file name is empty")
|
||||
ErrEmptyDocument = errors.New("document is empty")
|
||||
ErrEmptyPhoto = errors.New("photo is empty")
|
||||
ErrEmptyPhotoSize = errors.New("photo size is empty")
|
||||
@@ -105,9 +104,6 @@ func FileFromMedia(media tg.MessageMediaClass, customFileName string) (*types.Fi
|
||||
break
|
||||
}
|
||||
}
|
||||
if fileName == "" {
|
||||
return nil, ErrEmptyFileName
|
||||
}
|
||||
return &types.File{
|
||||
Location: document.AsInputDocumentFileLocation(),
|
||||
FileSize: document.Size,
|
||||
|
||||
Reference in New Issue
Block a user