添加拍一拍消息的判断支持

This commit is contained in:
eatmoreapple 2021-12-17 11:29:28 +08:00
parent 2db696d642
commit 9fa6b508aa

View File

@ -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, ":<br/>")
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, "拍了拍")
}