Documentation ¶
Index ¶
- func RegsiterParserElement(parser MessageElementParser)
- func Stringify([]MessageElement) (string, error)
- type Message
- type MessageElement
- type MessageElementA
- type MessageElementAt
- type MessageElementAudio
- type MessageElementAuthor
- type MessageElementButton
- type MessageElementCode
- type MessageElementDel
- type MessageElementEm
- type MessageElementFile
- type MessageElementImg
- type MessageElementIns
- type MessageElementMessage
- type MessageElementParser
- type MessageElementQuote
- type MessageElementSharp
- type MessageElementSpl
- type MessageElementStrong
- type MessageElementSub
- type MessageElementSup
- type MessageElementText
- type MessageElementVedio
- type MessageElmentBr
- type MessageElmentP
- type MessageList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegsiterParserElement ¶ added in v0.0.5
func RegsiterParserElement(parser MessageElementParser)
func Stringify ¶
func Stringify([]MessageElement) (string, error)
Types ¶
type Message ¶
type Message struct { Id string `json:"id"` Content string `json:"content"` Channel *channel.Channel `json:"channel,omitempty"` Guild *guild.Guild `json:"guild,omitempty"` Member *guildmember.GuildMember `json:"member,omitempty"` User *user.User `json:"user,omitempty"` CreateAt int64 `json:"create_at,omitempty"` UpdateAt int64 `json:"update_at,omitempty"` }
func (*Message) Decode ¶
func (m *Message) Decode(elements []MessageElement) error
func (*Message) Encode ¶
func (m *Message) Encode() ([]MessageElement, error)
type MessageElement ¶
func Parse ¶
func Parse(source string) ([]MessageElement, error)
type MessageElementA ¶
type MessageElementA struct { Href string // contains filtered or unexported fields }
func (*MessageElementA) Parse ¶ added in v0.0.5
func (e *MessageElementA) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementA) Stringify ¶
func (e *MessageElementA) Stringify() string
func (*MessageElementA) Tag ¶
func (e *MessageElementA) Tag() string
type MessageElementAt ¶
type MessageElementAt struct { Id string Name string // 收发 目标用户的名称 Role string // 收发 目标角色 Type string // 收发 特殊操作,例如 all 表示 @全体成员,here 表示 @在线成员 // contains filtered or unexported fields }
func (*MessageElementAt) Parse ¶ added in v0.0.5
func (e *MessageElementAt) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementAt) Stringify ¶
func (e *MessageElementAt) Stringify() string
func (*MessageElementAt) Tag ¶
func (e *MessageElementAt) Tag() string
type MessageElementAudio ¶
type MessageElementAudio struct {
// contains filtered or unexported fields
}
func (*MessageElementAudio) Parse ¶ added in v0.0.5
func (e *MessageElementAudio) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementAudio) Stringify ¶
func (e *MessageElementAudio) Stringify() string
func (*MessageElementAudio) Tag ¶
func (e *MessageElementAudio) Tag() string
type MessageElementAuthor ¶
type MessageElementAuthor struct { Id string Name string Avatar string // contains filtered or unexported fields }
func (*MessageElementAuthor) Parse ¶ added in v0.0.5
func (e *MessageElementAuthor) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementAuthor) Stringify ¶
func (e *MessageElementAuthor) Stringify() string
func (*MessageElementAuthor) Tag ¶
func (e *MessageElementAuthor) Tag() string
type MessageElementButton ¶
type MessageElementButton struct { // id string? 发 按钮的 ID // // type string? 发 按钮的类型 // href string? 发 按钮的链接 // text string? 发 待输入文本 // theme string? 发 按钮的样式 Id string Type string Href string Text string Theme string // contains filtered or unexported fields }
func (*MessageElementButton) Parse ¶ added in v0.0.5
func (e *MessageElementButton) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementButton) Stringify ¶
func (e *MessageElementButton) Stringify() string
func (*MessageElementButton) Tag ¶
func (e *MessageElementButton) Tag() string
type MessageElementCode ¶
type MessageElementCode struct {
// contains filtered or unexported fields
}
func (*MessageElementCode) Parse ¶ added in v0.0.5
func (e *MessageElementCode) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementCode) Stringify ¶
func (e *MessageElementCode) Stringify() string
func (*MessageElementCode) Tag ¶
func (e *MessageElementCode) Tag() string
type MessageElementDel ¶
type MessageElementDel struct {
// contains filtered or unexported fields
}
func (*MessageElementDel) Alias ¶
func (e *MessageElementDel) Alias() []string
func (*MessageElementDel) Parse ¶ added in v0.0.5
func (e *MessageElementDel) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementDel) Stringify ¶
func (e *MessageElementDel) Stringify() string
func (*MessageElementDel) Tag ¶
func (e *MessageElementDel) Tag() string
type MessageElementEm ¶
type MessageElementEm struct {
// contains filtered or unexported fields
}
func (*MessageElementEm) Alias ¶
func (e *MessageElementEm) Alias() []string
func (*MessageElementEm) Parse ¶ added in v0.0.5
func (e *MessageElementEm) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementEm) Stringify ¶
func (e *MessageElementEm) Stringify() string
func (*MessageElementEm) Tag ¶
func (e *MessageElementEm) Tag() string
type MessageElementFile ¶
type MessageElementFile struct {
// contains filtered or unexported fields
}
func (*MessageElementFile) Parse ¶ added in v0.0.5
func (e *MessageElementFile) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementFile) Stringify ¶
func (e *MessageElementFile) Stringify() string
func (*MessageElementFile) Tag ¶
func (e *MessageElementFile) Tag() string
type MessageElementImg ¶
type MessageElementImg struct { Width uint32 Height uint32 // contains filtered or unexported fields }
func (*MessageElementImg) Parse ¶ added in v0.0.5
func (e *MessageElementImg) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementImg) Stringify ¶
func (e *MessageElementImg) Stringify() string
func (*MessageElementImg) Tag ¶
func (e *MessageElementImg) Tag() string
type MessageElementIns ¶
type MessageElementIns struct {
// contains filtered or unexported fields
}
func (*MessageElementIns) Alias ¶
func (e *MessageElementIns) Alias() []string
func (*MessageElementIns) Parse ¶ added in v0.0.5
func (e *MessageElementIns) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementIns) Stringify ¶
func (e *MessageElementIns) Stringify() string
func (*MessageElementIns) Tag ¶
func (e *MessageElementIns) Tag() string
type MessageElementMessage ¶
type MessageElementMessage struct {
// contains filtered or unexported fields
}
func (*MessageElementMessage) Parse ¶ added in v0.0.5
func (e *MessageElementMessage) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementMessage) Stringify ¶
func (e *MessageElementMessage) Stringify() string
func (*MessageElementMessage) Tag ¶
func (e *MessageElementMessage) Tag() string
type MessageElementParser ¶ added in v0.0.5
type MessageElementQuote ¶
type MessageElementQuote struct {
// contains filtered or unexported fields
}
func (*MessageElementQuote) Parse ¶ added in v0.0.5
func (e *MessageElementQuote) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementQuote) Stringify ¶
func (e *MessageElementQuote) Stringify() string
func (*MessageElementQuote) Tag ¶
func (e *MessageElementQuote) Tag() string
type MessageElementSharp ¶
type MessageElementSharp struct { Id string //收发 目标频道的 ID Name string //收发 目标频道的名称 // contains filtered or unexported fields }
func (*MessageElementSharp) Parse ¶ added in v0.0.5
func (e *MessageElementSharp) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementSharp) Stringify ¶
func (e *MessageElementSharp) Stringify() string
func (*MessageElementSharp) Tag ¶
func (e *MessageElementSharp) Tag() string
type MessageElementSpl ¶
type MessageElementSpl struct {
// contains filtered or unexported fields
}
func (*MessageElementSpl) Parse ¶ added in v0.0.5
func (e *MessageElementSpl) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementSpl) Stringify ¶
func (e *MessageElementSpl) Stringify() string
func (*MessageElementSpl) Tag ¶
func (e *MessageElementSpl) Tag() string
type MessageElementStrong ¶
type MessageElementStrong struct {
// contains filtered or unexported fields
}
func (*MessageElementStrong) Alias ¶
func (e *MessageElementStrong) Alias() []string
func (*MessageElementStrong) Parse ¶ added in v0.0.5
func (e *MessageElementStrong) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementStrong) Stringify ¶
func (e *MessageElementStrong) Stringify() string
func (*MessageElementStrong) Tag ¶
func (e *MessageElementStrong) Tag() string
type MessageElementSub ¶
type MessageElementSub struct {
// contains filtered or unexported fields
}
func (*MessageElementSub) Parse ¶ added in v0.0.5
func (e *MessageElementSub) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementSub) Stringify ¶
func (e *MessageElementSub) Stringify() string
func (*MessageElementSub) Tag ¶
func (e *MessageElementSub) Tag() string
type MessageElementSup ¶
type MessageElementSup struct {
// contains filtered or unexported fields
}
func (*MessageElementSup) Parse ¶ added in v0.0.5
func (e *MessageElementSup) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementSup) Stringify ¶
func (e *MessageElementSup) Stringify() string
func (*MessageElementSup) Tag ¶
func (e *MessageElementSup) Tag() string
type MessageElementText ¶
type MessageElementText struct { Content string // contains filtered or unexported fields }
func (*MessageElementText) Parse ¶ added in v0.0.5
func (e *MessageElementText) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementText) Stringify ¶
func (e *MessageElementText) Stringify() string
func (*MessageElementText) Tag ¶
func (e *MessageElementText) Tag() string
type MessageElementVedio ¶
type MessageElementVedio struct {
// contains filtered or unexported fields
}
func (*MessageElementVedio) Parse ¶ added in v0.0.5
func (e *MessageElementVedio) Parse(n *html.Node) (MessageElement, error)
func (*MessageElementVedio) Stringify ¶
func (e *MessageElementVedio) Stringify() string
func (*MessageElementVedio) Tag ¶
func (e *MessageElementVedio) Tag() string
type MessageElmentBr ¶
type MessageElmentBr struct {
// contains filtered or unexported fields
}
func (*MessageElmentBr) Parse ¶ added in v0.0.5
func (e *MessageElmentBr) Parse(n *html.Node) (MessageElement, error)
func (*MessageElmentBr) Stringify ¶
func (e *MessageElmentBr) Stringify() string
func (*MessageElmentBr) Tag ¶
func (e *MessageElmentBr) Tag() string
type MessageElmentP ¶
type MessageElmentP struct {
// contains filtered or unexported fields
}
func (*MessageElmentP) Parse ¶ added in v0.0.5
func (e *MessageElmentP) Parse(n *html.Node) (MessageElement, error)
func (*MessageElmentP) Stringify ¶
func (e *MessageElmentP) Stringify() string
func (*MessageElmentP) Tag ¶
func (e *MessageElmentP) Tag() string
type MessageList ¶
Click to show internal directories.
Click to hide internal directories.