From 9fa6b508aaecd804579f800842df468d7438e436 Mon Sep 17 00:00:00 2001 From: eatmoreapple <15055461510@163.com> Date: Fri, 17 Dec 2021 11:29:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8B=8D=E4=B8=80=E6=8B=8D?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E7=9A=84=E5=88=A4=E6=96=AD=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- message.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/message.go b/message.go index d8522f4..d56c77f 100644 --- a/message.go +++ b/message.go @@ -388,7 +388,7 @@ func (m *Message) init(bot *Bot) { m.Raw = raw // 如果是群消息 if m.IsSendByGroup() { - if m.MsgType == MsgTypeText { + if m.IsText() { // 将Username和正文分开 data := strings.Split(m.Content, ":
") m.Content = strings.Join(data[1:], "") @@ -694,3 +694,9 @@ func (m *Message) String() string { func (m *Message) IsAt() bool { return m.isAt } + +// IsPaiYiPai 判断消息是否为拍一拍 +// 不要问我为什么取名为PaiYiPai,因为我也不知道取啥名字好 +func (m *Message) IsPaiYiPai() bool { + return m.IsSystem() && strings.Contains(m.Content, "拍了拍") +}