Documentation
¶
Index ¶
- func EstimateLength(elems []IMessageElement, limit int) int
- func ToProtoElems(elems []IMessageElement, generalFlags bool) (r []*msg.Elem)
- func ToReadableString(m []IMessageElement) (r string)
- func ToSrcProtoElems(elems []IMessageElement) (r []*msg.Elem)
- type AtElement
- type ElementType
- type FaceElement
- type ForwardElement
- type ForwardMessage
- type ForwardNode
- type FriendImageElement
- type GroupFileElement
- type GroupImageElement
- type GroupMessage
- type GroupVoiceElement
- type IMessageElement
- type ImageElement
- type PrivateMessage
- type ReplyElement
- type Sender
- type SendingMessage
- func (msg *SendingMessage) Any(filter func(e IMessageElement) bool) bool
- func (msg *SendingMessage) Append(e IMessageElement) *SendingMessage
- func (msg *SendingMessage) Count(filter func(e IMessageElement) bool) (c int)
- func (msg *SendingMessage) FirstOrNil(filter func(e IMessageElement) bool) IMessageElement
- func (msg *SendingMessage) ToFragmented() [][]IMessageElement
- type ServiceElement
- type ShortVideoElement
- type TempMessage
- type TextElement
- type VoiceElement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EstimateLength ¶
func EstimateLength(elems []IMessageElement, limit int) int
func ToProtoElems ¶
func ToProtoElems(elems []IMessageElement, generalFlags bool) (r []*msg.Elem)
func ToReadableString ¶
func ToReadableString(m []IMessageElement) (r string)
func ToSrcProtoElems ¶
func ToSrcProtoElems(elems []IMessageElement) (r []*msg.Elem)
Types ¶
type ElementType ¶
type ElementType int
const ( Text ElementType = iota Image Face At Reply Service Forward File Voice Video )
type FaceElement ¶
func NewFace ¶
func NewFace(index int32) *FaceElement
func (*FaceElement) Type ¶
func (e *FaceElement) Type() ElementType
type ForwardElement ¶
type ForwardElement struct {
ResId string
}
func (*ForwardElement) Type ¶
func (e *ForwardElement) Type() ElementType
type ForwardMessage ¶
type ForwardMessage struct {
Nodes []*ForwardNode
}
func (*ForwardMessage) CalculateValidationData ¶
func (forMsg *ForwardMessage) CalculateValidationData(seq, random int32, groupCode int64) ([]byte, []byte)
type ForwardNode ¶
type ForwardNode struct { SenderId int64 SenderName string Time int32 Message []IMessageElement }
type FriendImageElement ¶
func (*FriendImageElement) Type ¶
func (e *FriendImageElement) Type() ElementType
type GroupFileElement ¶
func (*GroupFileElement) Type ¶
func (e *GroupFileElement) Type() ElementType
type GroupImageElement ¶
func NewGroupImage ¶
func NewGroupImage(id string, md5 []byte, fid int64) *GroupImageElement
func (*GroupImageElement) Type ¶
func (e *GroupImageElement) Type() ElementType
type GroupMessage ¶
type GroupMessage struct { Id int32 InternalId int32 GroupCode int64 GroupName string Sender *Sender Time int32 Elements []IMessageElement }
func (*GroupMessage) ToString ¶
func (msg *GroupMessage) ToString() (res string)
type GroupVoiceElement ¶
func (*GroupVoiceElement) Type ¶
func (e *GroupVoiceElement) Type() ElementType
type IMessageElement ¶
type IMessageElement interface {
Type() ElementType
}
func ParseMessageElems ¶
func ParseMessageElems(elems []*msg.Elem) []IMessageElement
type ImageElement ¶
func NewImage ¶
func NewImage(data []byte) *ImageElement
func (*ImageElement) Type ¶
func (e *ImageElement) Type() ElementType
type PrivateMessage ¶
type PrivateMessage struct { Id int32 InternalId int32 Target int64 Time int32 Sender *Sender Elements []IMessageElement }
func (*PrivateMessage) ToString ¶
func (msg *PrivateMessage) ToString() (res string)
type ReplyElement ¶
type ReplyElement struct { ReplySeq int32 Sender int64 Time int32 Elements []IMessageElement }
func NewReply ¶
func NewReply(m *GroupMessage) *ReplyElement
func (*ReplyElement) Type ¶
func (e *ReplyElement) Type() ElementType
type SendingMessage ¶
type SendingMessage struct {
Elements []IMessageElement
}
func NewSendingMessage ¶
func NewSendingMessage() *SendingMessage
func (*SendingMessage) Any ¶
func (msg *SendingMessage) Any(filter func(e IMessageElement) bool) bool
func (*SendingMessage) Append ¶
func (msg *SendingMessage) Append(e IMessageElement) *SendingMessage
func (*SendingMessage) Count ¶
func (msg *SendingMessage) Count(filter func(e IMessageElement) bool) (c int)
func (*SendingMessage) FirstOrNil ¶
func (msg *SendingMessage) FirstOrNil(filter func(e IMessageElement) bool) IMessageElement
func (*SendingMessage) ToFragmented ¶
func (msg *SendingMessage) ToFragmented() [][]IMessageElement
type ServiceElement ¶
func NewUrlShare ¶
func NewUrlShare(url, title, content, image string) *ServiceElement
func (*ServiceElement) Type ¶
func (e *ServiceElement) Type() ElementType
type ShortVideoElement ¶
func (*ShortVideoElement) Type ¶
func (e *ShortVideoElement) Type() ElementType
type TempMessage ¶
type TempMessage struct { Id int32 GroupCode int64 GroupName string Sender *Sender Elements []IMessageElement }
func (*TempMessage) ToString ¶
func (msg *TempMessage) ToString() (res string)
type TextElement ¶
type TextElement struct {
Content string
}
func NewText ¶
func NewText(s string) *TextElement
func (*TextElement) Type ¶
func (e *TextElement) Type() ElementType
type VoiceElement ¶
type VoiceElement struct { Name string Md5 []byte Size int32 Url string // --- sending --- Data []byte }
func (*VoiceElement) Type ¶
func (e *VoiceElement) Type() ElementType
Click to show internal directories.
Click to hide internal directories.