diff --git a/message/elements.go b/message/elements.go index 6779f78c..1bd53d29 100644 --- a/message/elements.go +++ b/message/elements.go @@ -86,6 +86,10 @@ func NewAt(target int64, display ...string) *AtElement { } } +func AtAll() *AtElement { + return NewAt(0) +} + func (e *TextElement) Type() ElementType { return Text } diff --git a/message/message.go b/message/message.go index 99cb899d..be940517 100644 --- a/message/message.go +++ b/message/message.go @@ -119,7 +119,12 @@ func ToProtoElems(elems []IMessageElement) (r []*msg.Elem) { w.WriteUInt16(1) w.WriteUInt16(0) 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.WriteUInt16(0) }),