Documentation ¶
Index ¶
- Variables
- func DownloadMedia(ctx context.Context, mime, url string, maxSize int64) ([]byte, error)
- func UpdateAvatar(ctx context.Context, newAvatarURL string, avatarID *string, avatarSet *bool, ...) bool
- type AttachmentMessage
- type AttachmentMessageWithCaption
- type AttachmentTransport
- type ConvertedMessage
- type ConvertedMessagePart
- type MediaTransportContainer
- type MessageConverter
- func (mc *MessageConverter) IsPrivateChat(ctx context.Context) bool
- func (mc *MessageConverter) TextToWhatsApp(content *event.MessageEventContent) *waCommon.MessageText
- func (mc *MessageConverter) ToMatrix(ctx context.Context, msg *table.WrappedMessage) *ConvertedMessage
- func (mc *MessageConverter) ToMeta(ctx context.Context, evt *event.Event, content *event.MessageEventContent, ...) ([]socket.Task, int64, error)
- func (mc *MessageConverter) ToWhatsApp(ctx context.Context, evt *event.Event, content *event.MessageEventContent, ...) (*waConsumerApplication.ConsumerApplication, ...)
- func (mc *MessageConverter) WhatsAppTextToMatrix(ctx context.Context, text *waCommon.MessageText) *ConvertedMessagePart
- func (mc *MessageConverter) WhatsAppToMatrix(ctx context.Context, evt *events.FBMessage) *ConvertedMessage
- type PortalMethods
- type UTF16String
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnsupportedMsgType = errors.New("unsupported msgtype") ErrMediaDownloadFailed = errors.New("failed to download media") ErrMediaDecryptFailed = errors.New("failed to decrypt media") ErrMediaConvertFailed = errors.New("failed to convert") ErrMediaUploadFailed = errors.New("failed to upload media") ErrInvalidGeoURI = errors.New("invalid `geo:` URI in message") ErrURLNotFound = errors.New("url not found") )
View Source
var BypassOnionForMedia bool
View Source
var ErrTooLargeFile = errors.New("too large file")
View Source
var MediaReferer string
Functions ¶
func DownloadMedia ¶
Types ¶
type AttachmentMessage ¶
type AttachmentMessage[Integral MediaTransportContainer, Ancillary any, Transport AttachmentTransport[Integral, Ancillary]] interface { Decode() (Transport, error) }
type AttachmentMessageWithCaption ¶
type AttachmentMessageWithCaption[Integral MediaTransportContainer, Ancillary any, Transport AttachmentTransport[Integral, Ancillary]] interface { GetCaption() *waCommon.MessageText }
type AttachmentTransport ¶
type AttachmentTransport[Integral MediaTransportContainer, Ancillary any] interface { GetIntegral() Integral GetAncillary() Ancillary }
type ConvertedMessage ¶
type ConvertedMessage struct {
Parts []*ConvertedMessagePart
}
func (*ConvertedMessage) MergeCaption ¶
func (cm *ConvertedMessage) MergeCaption()
type ConvertedMessagePart ¶
type MediaTransportContainer ¶
type MediaTransportContainer interface {
GetTransport() *waMediaTransport.WAMediaTransport
}
type MessageConverter ¶
type MessageConverter struct { PortalMethods ConvertVoiceMessages bool ConvertGIFToAPNG bool MaxFileSize int64 AsyncFiles bool }
func (*MessageConverter) IsPrivateChat ¶
func (mc *MessageConverter) IsPrivateChat(ctx context.Context) bool
func (*MessageConverter) TextToWhatsApp ¶
func (mc *MessageConverter) TextToWhatsApp(content *event.MessageEventContent) *waCommon.MessageText
func (*MessageConverter) ToMatrix ¶
func (mc *MessageConverter) ToMatrix(ctx context.Context, msg *table.WrappedMessage) *ConvertedMessage
func (*MessageConverter) ToWhatsApp ¶
func (mc *MessageConverter) ToWhatsApp( ctx context.Context, evt *event.Event, content *event.MessageEventContent, relaybotFormatted bool, ) (*waConsumerApplication.ConsumerApplication, *waMsgApplication.MessageApplication_Metadata, error)
func (*MessageConverter) WhatsAppTextToMatrix ¶
func (mc *MessageConverter) WhatsAppTextToMatrix(ctx context.Context, text *waCommon.MessageText) *ConvertedMessagePart
func (*MessageConverter) WhatsAppToMatrix ¶
func (mc *MessageConverter) WhatsAppToMatrix(ctx context.Context, evt *events.FBMessage) *ConvertedMessage
type PortalMethods ¶
type PortalMethods interface { UploadMatrixMedia(ctx context.Context, data []byte, fileName, contentType string) (id.ContentURIString, error) DownloadMatrixMedia(ctx context.Context, uri id.ContentURIString) ([]byte, error) GetMatrixReply(ctx context.Context, messageID string, replyToUser int64) (replyTo id.EventID, replyTargetSender id.UserID) GetMetaReply(ctx context.Context, content *event.MessageEventContent) *socket.ReplyMetaData GetUserMXID(ctx context.Context, userID int64) id.UserID ShouldFetchXMA(ctx context.Context) bool GetThreadURL(ctx context.Context) (string, string) GetClient(ctx context.Context) *messagix.Client GetE2EEClient(ctx context.Context) *whatsmeow.Client GetData(ctx context.Context) *database.Portal }
type UTF16String ¶
type UTF16String []uint16
func NewUTF16String ¶
func NewUTF16String(s string) UTF16String
func (UTF16String) String ¶
func (u UTF16String) String() string
Click to show internal directories.
Click to hide internal directories.