chore: build
This commit is contained in:
@@ -96,25 +96,13 @@ func handleLinkAccount(c *gin.Context, token string, chatID int64) {
|
||||
if services.LBTelegram != nil && services.LBTelegram.IsConfigured() {
|
||||
if err := services.LBTelegram.EnrollUser(chatID, username, role); err != nil {
|
||||
log.Printf("⚠️ [LB] enrollment échoué pour %s: %v", username, err)
|
||||
}
|
||||
|
||||
// Envoyer un message avec boutons vers les bots de notifications lbtelegram
|
||||
if services.TelegramBot != nil && services.LBTelegram.Bot1Username != "" {
|
||||
buttons := [][2]string{
|
||||
{"🔔 Activer les notifications", "https://t.me/" + services.LBTelegram.Bot1Username},
|
||||
}
|
||||
if services.LBTelegram.Bot2Username != "" {
|
||||
buttons = append(buttons, [2]string{"🔔 Bot secondaire", "https://t.me/" + services.LBTelegram.Bot2Username})
|
||||
}
|
||||
if err := services.TelegramBot.SendMessageWithButtons(chatID,
|
||||
"✅ <b>Compte lié avec succès !</b>\n\nPour recevoir vos notifications de livraison, appuyez sur le bouton ci-dessous pour démarrer notre bot de notifications :",
|
||||
buttons,
|
||||
); err != nil {
|
||||
log.Printf("⚠️ [TELEGRAM] Envoi message boutons échoué pour %s: %v", username, err)
|
||||
// L'enrollment a échoué, on envoie quand même une confirmation simple
|
||||
if services.TelegramBot != nil {
|
||||
services.TelegramBot.SendMessage(chatID,
|
||||
"✅ <b>Compte lié avec succès !</b>\n\nVous recevrez désormais vos notifications ici.")
|
||||
}
|
||||
}
|
||||
// lbtelegram envoie lui-même le message d'enrollment avec le deep link vers le bot suivant
|
||||
} else if services.TelegramBot != nil {
|
||||
services.TelegramBot.SendMessage(chatID,
|
||||
"✅ <b>Compte lié avec succès !</b>\n\nVous recevrez désormais vos notifications ici.")
|
||||
|
||||
Reference in New Issue
Block a user