Cleanup condition

This commit is contained in:
2021-07-09 22:48:18 -04:00
parent 610ea960f1
commit 85dcaf5d2c

View File

@ -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.") k.SendMessageByConvID(m.ConvID, "Tesla returned an error. Please ensure your vehicle isn't currently being serviced.")
return return
} }
if strings.HasPrefix(err.Error(), "408") { if strings.HasPrefix(err.Error(), "408") && !m.Content.Attachment.Uploaded {
if !m.Content.Attachment.Uploaded {
k.SendMessageByConvID(m.ConvID, "Unable to wake vehicle within the timeframe. Trying to run the command again.") k.SendMessageByConvID(m.ConvID, "Unable to wake vehicle within the timeframe. Trying to run the command again.")
m.Content.Attachment.Uploaded = true m.Content.Attachment.Uploaded = true
handleChat(m) handleChat(m)
return return
}
} }
if strings.HasPrefix(err.Error(), "400") { 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) 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)