Browse Source

Cleanup condition

master
Gregory Rudolph 3 years ago
parent
commit
85dcaf5d2c
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 4
      commands.go

4
commands.go

@ -387,13 +387,11 @@ func handleError(err error, m chat1.MsgSummary, msg string) { @@ -387,13 +387,11 @@ func handleError(err error, m chat1.MsgSummary, msg string) {
k.SendMessageByConvID(m.ConvID, "Tesla returned an error. Please ensure your vehicle isn't currently being serviced.")
return
}
if strings.HasPrefix(err.Error(), "408") {
if !m.Content.Attachment.Uploaded {
if strings.HasPrefix(err.Error(), "408") && !m.Content.Attachment.Uploaded {
k.SendMessageByConvID(m.ConvID, "Unable to wake vehicle within the timeframe. Trying to run the command again.")
m.Content.Attachment.Uploaded = true
handleChat(m)
return
}
}
if strings.HasPrefix(err.Error(), "400") {
k.SendMessageByConvID(m.ConvID, "Tesla returned an error. The command you tried to use may need an update. Please contact @rudi9719 with tracking ID %+v and the bad command.", tracker)

Loading…
Cancel
Save