Goroutine the chat.React() calls
This commit is contained in:
@ -23,22 +23,22 @@ func send(e Email, api keybase.ChatAPI) {
|
|||||||
log.LogInfo("Message created")
|
log.LogInfo("Message created")
|
||||||
log.LogDebug(message)
|
log.LogDebug(message)
|
||||||
log.LogInfo("Sending message")
|
log.LogInfo("Sending message")
|
||||||
chat.React(api.Msg.ID, ":mailbox_with_no_mail:")
|
go chat.React(api.Msg.ID, ":mailbox_with_no_mail:")
|
||||||
if conf.KeyPass == "" {
|
if conf.KeyPass == "" {
|
||||||
chat.React(api.Msg.ID, ":unlock:")
|
go chat.React(api.Msg.ID, ":unlock:")
|
||||||
} else {
|
} else {
|
||||||
chat.React(api.Msg.ID, ":lock_with_ink_pen:")
|
go chat.React(api.Msg.ID, ":lock_with_ink_pen:")
|
||||||
}
|
}
|
||||||
err := smtp.SendMail(conf.SmtpServer,
|
err := smtp.SendMail(conf.SmtpServer,
|
||||||
smtp.PlainAuth("", conf.MyEmail, conf.EmailPass, conf.AuthServer),
|
smtp.PlainAuth("", conf.MyEmail, conf.EmailPass, conf.AuthServer),
|
||||||
conf.MyEmail, e.Recipients, []byte(message))
|
conf.MyEmail, e.Recipients, []byte(message))
|
||||||
chat.React(api.Msg.ID, ":mailbox_with_no_mail:")
|
go chat.React(api.Msg.ID, ":mailbox_with_no_mail:")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.LogErrorType(err)
|
log.LogErrorType(err)
|
||||||
chat.React(api.Msg.ID, ":warning:")
|
chat.React(api.Msg.ID, ":warning:")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
chat.React(api.Msg.ID, ":mailbox_with_mail:")
|
go chat.React(api.Msg.ID, ":mailbox_with_mail:")
|
||||||
log.LogInfo("Email Sent")
|
log.LogInfo("Email Sent")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user