add image conversion for telegram
This commit is contained in:
@@ -37,6 +37,24 @@ func (a Attachment) IsImage() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsVideo returns true if the attachment is a video.
|
||||
func (a Attachment) IsVideo() bool {
|
||||
switch a.Type {
|
||||
case "video/mp4", "video/quicktime", "video/webm", "video/mpeg":
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// IsAudio returns true if the attachment is an audio file.
|
||||
func (a Attachment) IsAudio() bool {
|
||||
switch a.Type {
|
||||
case "audio/mpeg", "audio/ogg", "audio/wav", "audio/mp4", "audio/aac":
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// UID extracts the uid part from "attachments/{uid}".
|
||||
func (a Attachment) UID() string {
|
||||
const prefix = "attachments/"
|
||||
|
||||
Reference in New Issue
Block a user