mirror of
https://github.com/ChuckNorrison/LightningTipBot.git
synced 2026-08-20 13:28:08 +02:00
Merge remote-tracking branch 'origin/dalle_retry1' into dalle_retry1
This commit is contained in:
commit
b4081df2fa
2 changed files with 5 additions and 2 deletions
|
|
@ -113,7 +113,7 @@ func (w *Server) receive(writer http.ResponseWriter, request *http.Request) {
|
|||
log.Errorln(err)
|
||||
return
|
||||
}
|
||||
c.Function(txInvoiceEvent)
|
||||
go c.Function(txInvoiceEvent)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,11 +106,12 @@ func (bot *TipBot) generateDalleImages(event Event) {
|
|||
log.Errorf("[generateDalleImages] invalid user")
|
||||
return
|
||||
}
|
||||
bot.trySendMessage(user.Telegram, "Your images are being generated. Please wait...")
|
||||
bot.trySendMessage(user.Telegram, "🔄 Your images are being generated. Please wait a few moments.")
|
||||
|
||||
// we can have only one user using dalle
|
||||
mutex.Lock("dalle-image-task")
|
||||
defer mutex.Unlock("dalle-image-task")
|
||||
time.Sleep(time.Second * 1)
|
||||
|
||||
// create the client with the bearer token api key
|
||||
dalleClient, err := dalle.NewHTTPClient(internal.Configuration.Generate.DalleKey)
|
||||
|
|
@ -229,5 +230,7 @@ func (bot *TipBot) dalleRefundUser(user *lnbits.User) error {
|
|||
log.Errorln(err)
|
||||
return err
|
||||
}
|
||||
log.Warnf("[DALLE] refunding user %s with %d sat", GetUserStr(user.Telegram), internal.Configuration.Generate.DallePrice)
|
||||
bot.trySendMessage(user.Telegram, "🚫 Something went wrong. You have been refunded.")
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue