Files
mautrix-telegram/pkg/gotd/telegram/message/gif.go
T
2025-06-27 20:03:37 -07:00

27 lines
640 B
Go

package message
import (
"context"
"go.mau.fi/mautrix-telegram/pkg/gotd/tg"
)
// GIF add attributes to create GIF attachment.
func (u *UploadedDocumentBuilder) GIF() *UploadedDocumentBuilder {
return u.Attributes(&tg.DocumentAttributeAnimated{}).
MIME(DefaultGifMIME)
}
// GIF adds gif attachment.
func GIF(file tg.InputFileClass, caption ...StyledTextOption) *UploadedDocumentBuilder {
return UploadedDocument(file, caption...).GIF()
}
// GIF sends gif.
func (b *Builder) GIF(
ctx context.Context,
file tg.InputFileClass, caption ...StyledTextOption,
) (tg.UpdatesClass, error) {
return b.Media(ctx, GIF(file, caption...))
}