1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00

fix AtAll.

This commit is contained in:
Mrs4s 2020-07-12 16:07:09 +08:00
parent 414c770818
commit 5a012f0cce
2 changed files with 10 additions and 1 deletions

View File

@ -86,6 +86,10 @@ func NewAt(target int64, display ...string) *AtElement {
} }
} }
func AtAll() *AtElement {
return NewAt(0)
}
func (e *TextElement) Type() ElementType { func (e *TextElement) Type() ElementType {
return Text return Text
} }

View File

@ -119,7 +119,12 @@ func ToProtoElems(elems []IMessageElement) (r []*msg.Elem) {
w.WriteUInt16(1) w.WriteUInt16(1)
w.WriteUInt16(0) w.WriteUInt16(0)
w.WriteUInt16(uint16(len(e.Display))) w.WriteUInt16(uint16(len(e.Display)))
w.WriteByte(0) w.WriteByte(func() byte {
if e.Target == 0 {
return 1
}
return 0
}())
w.WriteUInt32(uint32(e.Target)) w.WriteUInt32(uint32(e.Target))
w.WriteUInt16(0) w.WriteUInt16(0)
}), }),