Skip to content

Commit

Permalink
feat: 添加是否为附件消息的判断 (eatmoreapple#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
eatmoreapple authored Oct 16, 2023
1 parent 166d9d9 commit a841446
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion message.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,12 @@ func (m *Message) StatusNotify() bool {

// HasFile 判断消息是否为文件类型的消息
func (m *Message) HasFile() bool {
return m.IsPicture() || m.IsVoice() || m.IsVideo() || (m.IsMedia() && m.AppMsgType == AppMsgTypeAttach) || m.IsEmoticon()
return m.IsPicture() || m.IsVoice() || m.IsVideo() || m.HasAttachment() || m.IsEmoticon()
}

// HasAttachment 是否有附件
func (m *Message) HasAttachment() bool {
return m.IsMedia() && m.AppMsgType == AppMsgTypeAttach
}

// GetFile 获取文件消息的文件
Expand Down

0 comments on commit a841446

Please sign in to comment.