添加拍一拍消息的判断支持
This commit is contained in:
parent
2db696d642
commit
9fa6b508aa
@ -388,7 +388,7 @@ func (m *Message) init(bot *Bot) {
|
|||||||
m.Raw = raw
|
m.Raw = raw
|
||||||
// 如果是群消息
|
// 如果是群消息
|
||||||
if m.IsSendByGroup() {
|
if m.IsSendByGroup() {
|
||||||
if m.MsgType == MsgTypeText {
|
if m.IsText() {
|
||||||
// 将Username和正文分开
|
// 将Username和正文分开
|
||||||
data := strings.Split(m.Content, ":<br/>")
|
data := strings.Split(m.Content, ":<br/>")
|
||||||
m.Content = strings.Join(data[1:], "")
|
m.Content = strings.Join(data[1:], "")
|
||||||
@ -694,3 +694,9 @@ func (m *Message) String() string {
|
|||||||
func (m *Message) IsAt() bool {
|
func (m *Message) IsAt() bool {
|
||||||
return m.isAt
|
return m.isAt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsPaiYiPai 判断消息是否为拍一拍
|
||||||
|
// 不要问我为什么取名为PaiYiPai,因为我也不知道取啥名字好
|
||||||
|
func (m *Message) IsPaiYiPai() bool {
|
||||||
|
return m.IsSystem() && strings.Contains(m.Content, "拍了拍")
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user