add image conversion for telegram

This commit is contained in:
2026-02-13 09:37:54 +03:00
parent 1905e7ab16
commit e1ebb83641
5 changed files with 203 additions and 35 deletions
+18
View File
@@ -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/"