кастомный echotron + fix текста

This commit is contained in:
Artem Tsyrulnikov
2026-02-19 11:13:45 +03:00
parent 4b9e5bf4df
commit 5e25ea1a59
57 changed files with 11371 additions and 6 deletions

View File

@@ -319,8 +319,8 @@ func (s *PurchaseOptionalDetails) HandleCallback(b *bot.Bot, u *echotron.Update)
value := strings.TrimPrefix(u.CallbackQuery.Data, "type:")
// Нормализуем значение для БД
switch value {
case "self_promo":
s.PurchaseType = "самопиар"
case "mutual_pr":
s.PurchaseType = "взаимный пиар"
case "standard":
s.PurchaseType = "стандарт"
}
@@ -635,7 +635,7 @@ func (s *PurchaseOptionalDetails) renderInputPrompt(b *bot.Bot, mode bot.RenderM
case "type":
text += "<b>Выберите тип закупа</b>"
keyboard := Keyboard(
Row(Button("Самопиар", "type:self_promo"), Button("Стандарт", "type:standard")),
Row(Button("Взаимный пиар", "type:mutual_pr"), Button("Стандарт", "type:standard")),
Row(Button("← Назад", "back_to_optional")),
)
if mode == bot.EditMessage {
@@ -2363,8 +2363,8 @@ func (s *PurchaseOptionalDetails) normalizePurchaseType() (*string, bool) {
normalized := strings.ToLower(raw)
normalized = strings.TrimSpace(strings.Trim(normalized, "."))
switch normalized {
case "самопиар", "само пиар", "self_promo", "self promo", "вп", "vp":
value := "self_promo"
case "взаимный пиар", "взаимнопиар", "mutual_pr", "mutual pr", "вп", "vp":
value := "mutual_pr"
return &value, true
case "стандарт", "standard":
value := "standard"