message

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2024 License: AGPL-3.0 Imports: 20 Imported by: 10

Documentation

Index

Constants

View Source
const (
	AtTypeGroupMember = 0 // At群成员
)

Variables

View Source
var DefaultThumb, _ = base64.StdEncoding.DecodeString("/9j/4AAQSkZJRgABAQAAAQABAAD//gAXR2VuZXJhdGVkIGJ5IFNuaXBhc3Rl/9sAhAAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47AQoLCw4NDhwQEBw7KCIoOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCAF/APADAREAAhEBAxEB/8QBogAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoLEAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+foBAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKCxEAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDiAayNxwagBwNAC5oAM0xBmgBM0ANJoAjY0AQsaBkTG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AhtABQAUAFMAoEFABQIKAEoASgQUALQAooAWgQUAW81mbC0CCgApgFACUAIaAEpgJQAUAFABQAhFMBpFADSKAGkUCExQAYoAMUAGKADFMQYoAMUCExSATFABQIKYBQAtABQIt5qDYM0ALmgQtIApgIaAENADaACmAlAC0ALQAUwGkUANIoAaRQAmKBBigAxQAYoAMUAGKBBigBMUAJigQmKAExTAKBC0AFAFnNQaig0AKDQAtAgoASgBDQAlMBKACgAFADhQAtMBCKAGkUAIRQAmKADFABigQmKADFACYoAXFABigQmKAExQAmKBCYpgJigAoAnzUGgZoAcDQAuaBC0AJQAhoASmAlABQAtADhQAtMAoATFACEUAJigAxQAYoATFAhMUAFABQAuKADFABigBpWgBCKBCYpgJigB+ag0DNADgaBDgaAFzQITNACUAJTAKACgBRQAopgOoAWgBKAEoAKACgAoASgBpoEJQAooAWgBaBhigBMUCEIoAQigBMUAJSLCgBQaBDgaQC5oEFACUwCgBKACmAtADhQA4UALQAUAJQAUAJQAUAJQAhoENoAWgBRQAooGLQAUAGKAGkUAIRQIZSKEoGKKBDhQAUCCgAoAKBBQAUwFoGKKAHCgBaACgAoASgAoASgBCaAEoEJmgAoAUGgBQaAHZoGFABQAUANoAjpDEoAWgBaAFoEFACUALQAUCCmAUAOFAxRQAtAC0AJQAUAJQAmaBDSaAEzQAmaYBmgBQaAHA0gFzQAuaBhmgAzQAlAEdIYUALQAtAgoAKAEoEFAC0AFMAoAUUDFFAC0ALQAUAJQAhoENNACE0wEoATNABmgBc0ALmgBc0gDNAC5oATNABmgBKRQlACigB1AgoASgQlABTAWgBKACgBaBi0ALQAZoAM0AFACGgQ00wENACUAJQAUCFzQMM0ALmgAzQAZoAM0AGaQC0igoAUUALQIWgBDQISmAUAFACUAFABQAuaBi5oAM0AGaBBmgBKAEpgIaAG0AJQAUCFoAM0DDNAC5oATNABmgAzQBJUlBQAooAWgQtACGmIaaACgAoASgBKACgBc0DCgQUAGaADNABTASgBDQAlACUAFAgoAKBhQAUAFABQAlAE1SUFAxRQIWgQtMBDQIQ0AJQAlAhKBiUAFABmgBc0AGaADNABTAKACgBKAEoASgQlABQAUAFAC0AFACUAFAE1SaBQAUCHCgQtMBKBCUAJQISgBDQA00DEzQAuaADNMBc0AGaADNABQAUAJQAlABQISgAoAKACgBaACgBKAEoAnqTQSgBRQIcKBC0xCUAJQISgBKAENADDQAmaYwzQAuaADNAC0AFABQAUAFAhKACgBKACgAoAWgAoELQAlAxKAJqk0EoAWgQooELTEFADaBCUABoENNMY00ANNAwzQAZoAXNAC0AFAC0CFoASgAoASgBKACgAoAWgQtABQAUANNAyWpNAoAKBCimIWgQUCEoASmIQ0ANNADTQMaaAEoGLmgAzQAtADhQIWgBaACgQhoASgYlACUALQIWgBaACgBKAENAyWpNBKYBQIcKBC0CEoEJTAKBCUANNADDQMQ0ANoGFAC5oAUGgBwNAhRQIWgBaAENACGgBtAwoAKAFzQIXNABmgAoAQ0DJKRoJQAtAhRQSLQIKYCUCCgBDQA00AMNAxpoGNoAM0AGaAFBoAcDQIcKBDqACgBDQAhoAQ0DEoAKADNAC5oEGaBhmgAoAkpGgUCCgQooELQIKYhKACgBKAGmgBpoGMNAxDQAlAwzQIUUAOFAhwoAcKBC0AJQAhoGNNACUAFABQAZoAXNABQAUAS0ixKACgQoNAhaYgoEFACUABoAaaAGmgYw0DENAxtABQAooEOFADhQIcKAFoASgBDQAhoGJQAUAFACUALQIKBi0CJDSLEoATNAhc0CHZpiCgQUAJQIKBjTQAhoGNNAxpoATFABigBQKAHCgBwoAWgAoAKACgBKAEoASgAoASgBaAAUAOoEONIoaTQAZoAUGmIUGgQtAgzQISgAoAQ0DGmgYlAxKACgAxQAtACigBRQAtAxaACgAoATFABigBCKAG0CEoAWgBRTAUUAf//Z")

Functions

func ElementsHasType

func ElementsHasType(elems []IMessageElement, t ElementType) bool

func PackElements

func PackElements(msgElems []IMessageElement) []*message.Elem

func PackElementsToBody

func PackElementsToBody(msgElems []IMessageElement) (msgBody *message.MessageBody)

func ToReadableString

func ToReadableString(m []IMessageElement) string

func ToReadableStringEle

func ToReadableStringEle(elem IMessageElement) string

Types

type AnonymousInfo

type AnonymousInfo struct {
	AnonymousID   string
	AnonymousNick string
}

type AtElement

type AtElement struct {
	TargetUin uint32
	TargetUID string
	Display   string
	SubType   AtType
}

func NewAt

func NewAt(target uint32, display ...string) *AtElement

func (*AtElement) BuildElement

func (e *AtElement) BuildElement() []*message.Elem

func (*AtElement) Type

func (e *AtElement) Type() ElementType

type AtType

type AtType int

type Config

type Config struct {
	Autosize int64  `json:"autosize"`
	Forward  int64  `json:"forward"`
	Round    int64  `json:"round"`
	Type     string `json:"type"`
	Width    int64  `json:"width"`
}

type Detail

type Detail struct {
	News    []News `json:"news"`
	Resid   string `json:"resid"`
	Source  string `json:"source"`
	Summary string `json:"summary"`
	UniSeq  string `json:"uniseq"`
}

type ElementBuilder

type ElementBuilder interface {
	BuildElement() []*message.Elem
}

type ElementType

type ElementType int
const (
	Text     ElementType = iota // 文本
	Image                       // 图片
	Face                        // 表情
	At                          // 艾特
	Reply                       // 回复
	Service                     // 服务
	Forward                     // 转发
	File                        // 文件
	Voice                       // 语音
	Video                       // 视频
	LightApp                    // 轻应用
	RedBag                      // 红包
)

type FaceElement

type FaceElement struct {
	FaceID   uint16
	ResultID uint16 // 猜拳和骰子的值
	// contains filtered or unexported fields
}

func NewDice added in v0.1.1

func NewDice(value uint16) *FaceElement

func NewFace added in v0.1.1

func NewFace(id uint16) *FaceElement

func NewFingerGuessing added in v0.1.1

func NewFingerGuessing(value FingerGuessingType) *FaceElement

func (*FaceElement) BuildElement

func (e *FaceElement) BuildElement() []*message.Elem

func (*FaceElement) Type

func (e *FaceElement) Type() ElementType

type FileElement

type FileElement struct {
	FileSize uint64
	FileName string
	FileMd5  []byte
	FileURL  string
	FileID   string // group
	FileUUID string // private
	FileHash string

	// send
	FileStream io.ReadSeeker
	FileSha1   []byte
}

func NewFile

func NewFile(data []byte, fileName string) *FileElement

func NewLocalFile

func NewLocalFile(path string, name ...string) (*FileElement, error)

func NewStreamFile

func NewStreamFile(r io.ReadSeeker, fileName string) *FileElement

func (*FileElement) BuildContent

func (e *FileElement) BuildContent() []byte

func (*FileElement) Type

func (e *FileElement) Type() ElementType

type FingerGuessingType added in v0.1.1

type FingerGuessingType uint16
const (
	FingerGuessingRock     FingerGuessingType = 3 // 石头
	FingerGuessingScissors FingerGuessingType = 2 // 剪刀
	FingerGuessingPaper    FingerGuessingType = 1 // 布
)

func (FingerGuessingType) String added in v0.1.1

func (m FingerGuessingType) String() string

type ForwardMessage

type ForwardMessage struct {
	IsGroup bool
	SelfID  uint32
	ResID   string
	Nodes   []*ForwardNode
}

func NewForward

func NewForward(resid string, nodes []*ForwardNode) *ForwardMessage

func NewForwardWithNodes

func NewForwardWithNodes(nodes []*ForwardNode) *ForwardMessage

func NewForwardWithResID

func NewForwardWithResID(resid string) *ForwardMessage

func (*ForwardMessage) BuildElement

func (e *ForwardMessage) BuildElement() []*message.Elem

func (*ForwardMessage) Type

func (e *ForwardMessage) Type() ElementType

type ForwardNode

type ForwardNode struct {
	GroupID    uint32
	SenderID   uint32
	SenderName string
	Time       uint32
	Message    []IMessageElement
}

type GroupEssenceMessage

type GroupEssenceMessage struct {
	OperatorUin  uint32
	OperatorUID  string
	OperatorTime uint64
	CanRemove    bool
	Message      *GroupMessage
}

type GroupMessage

type GroupMessage struct {
	ID             uint32
	InternalID     uint32
	GroupUin       uint32
	GroupName      string
	Sender         *Sender
	Time           uint32
	Elements       []IMessageElement
	OriginalObject *message.PushMsgBody
}

func ParseGroupMessage

func ParseGroupMessage(msg *message.PushMsgBody) *GroupMessage

func (*GroupMessage) Chat

func (msg *GroupMessage) Chat() int64

func (*GroupMessage) GetElements

func (msg *GroupMessage) GetElements() []IMessageElement

func (*GroupMessage) Texts

func (msg *GroupMessage) Texts() []string

func (*GroupMessage) ToString

func (msg *GroupMessage) ToString() string

type IMessage

type IMessage interface {
	GetElements() []IMessageElement
	Chat() int64
	ToString() string
	Texts() []string
}

type IMessageElement

type IMessageElement interface {
	Type() ElementType
}

func ParseMessageBody

func ParseMessageBody(body *message.MessageBody, isGroup bool) []IMessageElement

func ParseMessageElements

func ParseMessageElements(msg []*message.Elem) []IMessageElement

type ImageElement

type ImageElement struct {
	ImageID  string
	FileUUID string // only in new protocol photo
	Size     uint32
	Width    uint32
	Height   uint32
	URL      string
	SubType  int32

	// EffectID show pic effect id.
	EffectID int32 // deprecated
	Flash    bool

	// send & receive
	Summary string
	Md5     []byte // only in old protocol photo
	IsGroup bool

	Sha1        []byte
	MsgInfo     *oidb.MsgInfo
	Stream      io.ReadSeeker
	CompatFace  *message.CustomFace     // GroupImage
	CompatImage *message.NotOnlineImage // FriendImage
}

func NewFileImage

func NewFileImage(path string, summary ...string) (*ImageElement, error)

func NewImage

func NewImage(data []byte, summary ...string) *ImageElement

func NewStreamImage

func NewStreamImage(r io.ReadSeeker, summary ...string) *ImageElement

func (*ImageElement) BuildElement

func (e *ImageElement) BuildElement() []*message.Elem

func (*ImageElement) Type

func (e *ImageElement) Type() ElementType

type LightAppElement

type LightAppElement struct {
	AppName string
	Content string
}

func NewLightApp

func NewLightApp(content string) *LightAppElement

func (*LightAppElement) BuildElement

func (e *LightAppElement) BuildElement() []*message.Elem

func (*LightAppElement) Type

func (e *LightAppElement) Type() ElementType

type Meta

type Meta struct {
	Detail Detail `json:"detail"`
}

type MsgContentBuilder

type MsgContentBuilder interface {
	BuildContent() []byte
}

type MultiItem

type MultiItem struct {
	Layout  int          `xml:"layout,attr"`
	Title   []MultiTitle `xml:"title"`
	Summary MultiSummary `xml:"summary"`
}

type MultiMessage

type MultiMessage struct {
	XMLName    xml.Name    `xml:"msg"`
	ServiceID  uint        `xml:"serviceID,attr"`
	TemplateID int         `xml:"templateID,attr"`
	Action     string      `xml:"action,attr"`
	Brief      string      `xml:"brief,attr"`
	FileName   string      `xml:"m_fileName,attr"`
	ResID      string      `xml:"m_resid,attr"`
	Total      int         `xml:"tSum,attr"`
	Flag       int         `xml:"flag,attr"`
	Item       MultiItem   `xml:"item"`
	Source     MultiSource `xml:"source"`
}

type MultiMsgLightApp

type MultiMsgLightApp struct {
	App    string `json:"app"`
	Config Config `json:"config"`
	Desc   string `json:"desc"`
	Extra  string `json:"extra"`
	Meta   Meta   `json:"meta"`
	Prompt string `json:"prompt"`
	Ver    string `json:"ver"`
	View   string `json:"view"`
}

type MultiMsgLightAppExtra

type MultiMsgLightAppExtra struct {
	FileName string `json:"filename"`
	Sum      int    `json:"tsum"`
}

type MultiSource

type MultiSource struct {
	Name string `xml:"name,attr"`
}

type MultiSummary

type MultiSummary struct {
	Color string `xml:"color,attr"`
	Text  string `xml:",chardata"`
}

type MultiTitle

type MultiTitle struct {
	Color string `xml:"color,attr"`
	Size  int    `xml:"size,attr"`
	Text  string `xml:",chardata"`
}

type News

type News struct {
	Text string `json:"text"`
}

type PrivateMessage

type PrivateMessage struct {
	ID         uint32
	InternalID uint32
	ClientSeq  uint32
	Self       uint32
	Target     uint32
	Time       uint32
	Sender     *Sender
	Elements   []IMessageElement
}

func ParsePrivateMessage

func ParsePrivateMessage(msg *message.PushMsgBody) *PrivateMessage

func (*PrivateMessage) Chat

func (msg *PrivateMessage) Chat() int64

func (*PrivateMessage) GetElements

func (msg *PrivateMessage) GetElements() []IMessageElement

func (*PrivateMessage) Texts

func (msg *PrivateMessage) Texts() []string

func (*PrivateMessage) ToString

func (msg *PrivateMessage) ToString() string

type ReplyElement

type ReplyElement struct {
	ReplySeq  uint32
	SenderUin uint32
	SenderUID string
	GroupUin  uint32 // 私聊回复群聊时
	Time      uint32
	Elements  []IMessageElement
}

func NewGroupReply

func NewGroupReply(m *GroupMessage) *ReplyElement

func NewPrivateReply

func NewPrivateReply(m *PrivateMessage) *ReplyElement

func (*ReplyElement) BuildElement

func (e *ReplyElement) BuildElement() []*message.Elem

func (*ReplyElement) Type

func (e *ReplyElement) Type() ElementType

type Sender

type Sender struct {
	Uin           uint32
	UID           string
	Nickname      string
	CardName      string
	AnonymousInfo *AnonymousInfo
	IsFriend      bool
}

func (*Sender) IsAnonymous

func (s *Sender) IsAnonymous() bool

type SendingMessage

type SendingMessage struct {
	Elements []IMessageElement
}

func NewSendingMessage

func NewSendingMessage() *SendingMessage

func (*SendingMessage) Append

Append 要传入msg的引用

func (*SendingMessage) FirstOrNil

func (msg *SendingMessage) FirstOrNil(f func(element IMessageElement) bool) IMessageElement

func (*SendingMessage) GetElems

func (msg *SendingMessage) GetElems() []IMessageElement

type ShortVideoElement

type ShortVideoElement struct {
	Name     string
	UUID     []byte
	Size     uint32
	URL      string
	Duration uint32

	// send
	Thumb   *VideoThumb
	Summary string
	Md5     []byte
	Sha1    []byte
	Stream  io.ReadSeeker
	MsgInfo *oidb.MsgInfo
	Compat  *message.VideoFile
}

func NewFileVideo

func NewFileVideo(path string, thumb []byte, summary ...string) (*ShortVideoElement, error)

func NewStreamVideo

func NewStreamVideo(r io.ReadSeeker, thumb io.ReadSeeker, summary ...string) *ShortVideoElement

func NewVideo

func NewVideo(data, thumb []byte, summary ...string) *ShortVideoElement

func (*ShortVideoElement) BuildElement

func (e *ShortVideoElement) BuildElement() []*message.Elem

func (*ShortVideoElement) Type

func (e *ShortVideoElement) Type() ElementType

type Source

type Source struct {
	SourceType SourceType
	PrimaryID  int64 // 群号/QQ号/guild_id
}

Source 消息来源

type SourceType

type SourceType byte
const (
	SourcePrivate SourceType = 1 << iota
	SourceGroup   SourceType = 1 << iota
)

MessageSourceType 常量

func (SourceType) String

func (t SourceType) String() string

type TempMessage

type TempMessage struct {
	ID        uint32
	GroupUin  uint32
	GroupName string
	Self      uint32
	Sender    *Sender
	Elements  []IMessageElement
}

func ParseTempMessage

func ParseTempMessage(msg *message.PushMsgBody) *TempMessage

func (*TempMessage) Chat

func (msg *TempMessage) Chat() int64

func (*TempMessage) GetElements

func (msg *TempMessage) GetElements() []IMessageElement

func (*TempMessage) Texts

func (msg *TempMessage) Texts() []string

func (*TempMessage) ToString

func (msg *TempMessage) ToString() string

type TextElement

type TextElement struct {
	Content string
}

func NewText

func NewText(s string) *TextElement

func (*TextElement) BuildElement

func (e *TextElement) BuildElement() []*message.Elem

func (*TextElement) Type

func (e *TextElement) Type() ElementType

type VideoThumb

type VideoThumb struct {
	Stream io.ReadSeeker
	Size   uint32
	Md5    []byte
	Sha1   []byte
	Width  uint32
	Height uint32
}

func NewVideoThumb

func NewVideoThumb(r io.ReadSeeker) *VideoThumb

type VoiceElement

type VoiceElement struct {
	Name string
	UUID string
	Size uint32
	URL  string
	Md5  []byte
	Sha1 []byte
	Node *oidb.IndexNode

	// --- sending ---
	MsgInfo  *oidb.MsgInfo
	Compat   []byte
	Duration uint32
	Stream   io.ReadSeeker
	Summary  string
}

func NewFileRecord

func NewFileRecord(path string, summary ...string) (*VoiceElement, error)

func NewRecord

func NewRecord(data []byte, summary ...string) *VoiceElement

func NewStreamRecord

func NewStreamRecord(r io.ReadSeeker, summary ...string) *VoiceElement

func (*VoiceElement) BuildElement

func (e *VoiceElement) BuildElement() []*message.Elem

func (*VoiceElement) Type

func (e *VoiceElement) Type() ElementType

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL