add image conversion for telegram
This commit is contained in:
@@ -46,15 +46,19 @@ func formatMemory(mem *search.Memory, publicURL string) string {
|
||||
return b.String()
|
||||
}
|
||||
|
||||
// imageAttachments returns image attachments from the memo.
|
||||
func imageAttachments(memo *memos.Memo) []memos.Attachment {
|
||||
var images []memos.Attachment
|
||||
// mediaAttachments splits memo attachments into images, videos, and audios.
|
||||
func mediaAttachments(memo *memos.Memo) (images, videos, audios []memos.Attachment) {
|
||||
for _, att := range memo.Attachments {
|
||||
if att.IsImage() {
|
||||
switch {
|
||||
case att.IsImage():
|
||||
images = append(images, att)
|
||||
case att.IsVideo():
|
||||
videos = append(videos, att)
|
||||
case att.IsAudio():
|
||||
audios = append(audios, att)
|
||||
}
|
||||
}
|
||||
return images
|
||||
return
|
||||
}
|
||||
|
||||
// splitText splits text into chunks of at most maxLen bytes,
|
||||
|
||||
Reference in New Issue
Block a user