diff --git a/protocol/message.go b/protocol/message.go index 0dce7bbb3..b6f363bc2 100644 --- a/protocol/message.go +++ b/protocol/message.go @@ -262,7 +262,7 @@ func (m *Message) parseImage() error { } // parseAudio check the message contains an audio, and if so -// it creates the a base64 encoded version of it. +// it creates a base64 encoded version of it. func (m *Message) parseAudio() error { if m.ContentType != protobuf.ChatMessage_AUDIO { return nil diff --git a/protocol/messenger.go b/protocol/messenger.go index ef78d05a2..54718aec5 100644 --- a/protocol/messenger.go +++ b/protocol/messenger.go @@ -1400,11 +1400,13 @@ func (m *Messenger) SendChatMessage(ctx context.Context, message *Message) (*Mes if audioMessage == nil { return nil, errors.New("no audio has been passed") } - m.logger.Info("Audio", zap.Any("audio", audioMessage)) - m.logger.Info("Duration", zap.Uint64("duration", audioMessage.DurationMs)) audioMessage.Payload = payload audioMessage.Type = audio.Type(payload) message.Payload = &protobuf.ChatMessage_Audio{Audio: audioMessage} + err = os.Remove(message.AudioPath) + if err != nil { + return nil, err + } } logger := m.logger.With(zap.String("site", "Send"), zap.String("chatID", message.ChatId))