增加实时位置消息并重命名
Signed-off-by: MiiW <mii.w@foxmail.com>
This commit is contained in:
parent
3b8019afa2
commit
3fc3e44d78
16
message.go
16
message.go
@ -185,8 +185,20 @@ func (m *Message) IsText() bool {
|
||||
return m.MsgType == MsgTypeText && m.Url == ""
|
||||
}
|
||||
|
||||
func (m *Message) IsMap() bool {
|
||||
return m.MsgType == MsgTypeText && m.Url != ""
|
||||
func (m *Message) IsLocation() bool {
|
||||
return m.MsgType == MsgTypeText && strings.Contains(m.Url, "api.map.qq.com") && strings.Contains(m.Content, "pictype=location")
|
||||
}
|
||||
|
||||
func (m *Message) IsRealtimeLocation() bool {
|
||||
return m.IsRealtimeLocationStart() || m.IsRealtimeLocationStop()
|
||||
}
|
||||
|
||||
func (m *Message) IsRealtimeLocationStart() bool {
|
||||
return m.MsgType == MsgTypeApp && m.AppMsgType == AppMsgTypeRealtimeShareLocation
|
||||
}
|
||||
|
||||
func (m *Message) IsRealtimeLocationStop() bool {
|
||||
return m.MsgType == MsgTypeSys && m.Content == "位置共享已经结束"
|
||||
}
|
||||
|
||||
func (m *Message) IsPicture() bool {
|
||||
|
@ -51,7 +51,7 @@ msg.IsPicture()
|
||||
##### 位置消息
|
||||
|
||||
```go
|
||||
msg.IsMap()
|
||||
msg.IsLocation()
|
||||
```
|
||||
|
||||
##### 语音消息
|
||||
|
Loading…
x
Reference in New Issue
Block a user