домен обновлен
This commit is contained in:
@@ -1283,9 +1283,13 @@ func (s *PurchaseOptionalDetails) createPurchase(b *bot.Bot, jwt string) {
|
||||
}
|
||||
}
|
||||
|
||||
b.SendNew("✅ Закуп создан", bot.Keyboard(
|
||||
bot.Row(bot.Button("● Готово", "done")),
|
||||
))
|
||||
b.SetState(&PurchaseDetails{
|
||||
WorkspaceID: s.WorkspaceID,
|
||||
ProjectID: s.ProjectID,
|
||||
ProjectTitle: s.ProjectTitle,
|
||||
PurchaseID: purchase.ID,
|
||||
BackState: s.BackState,
|
||||
}, bot.NewMessage)
|
||||
}
|
||||
|
||||
func (s *PurchaseOptionalDetails) buildPurchaseDetails(purchaseType *string) *backend.PurchaseDetails {
|
||||
@@ -1449,5 +1453,15 @@ func (s *PurchaseOptionalDetails) injectInviteLink(text, inviteLink string) stri
|
||||
return text
|
||||
}
|
||||
re := regexp.MustCompile(`<a\s+class="tg-link">([^<]*)</a>`)
|
||||
return re.ReplaceAllString(text, fmt.Sprintf(`<a href="%s">$1</a>`, inviteLink))
|
||||
return re.ReplaceAllStringFunc(text, func(match string) string {
|
||||
sub := re.FindStringSubmatch(match)
|
||||
if len(sub) < 2 {
|
||||
return match
|
||||
}
|
||||
inner := strings.TrimSpace(sub[1])
|
||||
if inner == "" {
|
||||
return fmt.Sprintf(`<a href="%s">%s</a>`, inviteLink, inviteLink)
|
||||
}
|
||||
return fmt.Sprintf(`<a href="%s">%s</a>`, inviteLink, sub[1])
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user