[feat]: 添加判断当前消息是否为拍了拍自己 (#209)

This commit is contained in:
多吃点苹果 2023-01-21 09:32:46 +08:00 committed by GitHub
parent fc38bfb401
commit 1a13e73355
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -791,7 +791,7 @@ func (m *Message) IsAt() bool {
// IsPaiYiPai 判断消息是否为拍一拍
// 不要问我为什么取名为PaiYiPai因为我也不知道取啥名字好
func (m *Message) IsPaiYiPai() bool {
return m.IsSystem() && strings.Contains(m.Content, "拍了拍")
return m.IsTickled()
}
// IsJoinGroup 判断是否有人加入了群聊
@ -801,7 +801,12 @@ func (m *Message) IsJoinGroup() bool {
// IsTickled 判断消息是否为拍一拍
func (m *Message) IsTickled() bool {
return m.IsPaiYiPai()
return m.IsSystem() && strings.Contains(m.Content, "拍了拍")
}
// IsTickledMe 判断消息是否拍了拍自己
func (m *Message) IsTickledMe() bool {
return m.IsSystem() && strings.HasSuffix(m.Content, "拍了拍我")
}
// IsVoipInvite 判断消息是否为语音或视频通话邀请