Update protocol/message.go
Co-authored-by: Samuel Hawksby-Robinson <samuel@samyoul.com>
This commit is contained in:
parent
bdb2708a39
commit
4ae2c59e9b
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue