ruspet_portal_back/service/telegram_service/keyboard/builder.go

213 lines
7.2 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package keyboard
import tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
// MainMenuKeyboard - главное меню (без изменений в структуре)
func MainMenuKeyboard() tgbotapi.ReplyKeyboardMarkup {
return tgbotapi.NewReplyKeyboard(
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Согласование"),
tgbotapi.NewKeyboardButton("Мои заявки"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Отложенные"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("❓ Как создать согласование"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Предложения и пожелания"),
),
)
}
func ExecutorMenuKeyboard() tgbotapi.ReplyKeyboardMarkup {
return tgbotapi.NewReplyKeyboard(
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Согласование"),
tgbotapi.NewKeyboardButton("Мои заявки"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Мои задачи"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("❓ Как создать согласование"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Предложения и пожелания"),
),
)
}
func ApproverExecutorMenuKeyboard() tgbotapi.ReplyKeyboardMarkup {
return tgbotapi.NewReplyKeyboard(
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Согласование"),
tgbotapi.NewKeyboardButton("Мои заявки"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Согласовать"),
tgbotapi.NewKeyboardButton("Мои задачи"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Отложенные"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("❓ Как создать согласование"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Предложения и пожелания"),
),
)
}
func ObserverExecutorMenuKeyboard() tgbotapi.ReplyKeyboardMarkup {
return tgbotapi.NewReplyKeyboard(
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Согласование"),
tgbotapi.NewKeyboardButton("Мои заявки"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Наблюдаемые"),
tgbotapi.NewKeyboardButton("Мои задачи"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Отложенные"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("❓ Как создать согласование"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Предложения и пожелания"),
),
)
}
func ApproverObserverExecutorMenuKeyboard() tgbotapi.ReplyKeyboardMarkup {
return tgbotapi.NewReplyKeyboard(
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Согласование"),
tgbotapi.NewKeyboardButton("Мои заявки"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Согласовать"),
tgbotapi.NewKeyboardButton("Мои задачи"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Отложенные"),
tgbotapi.NewKeyboardButton("Наблюдаемые"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("❓ Как создать согласование"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Предложения и пожелания"),
),
)
}
// ApprovalsSubmenuKeyboard - подменю "Согласования"
func ApprovalsSubmenuKeyboard(isObserver, isApprover bool) tgbotapi.ReplyKeyboardMarkup {
rows := [][]tgbotapi.KeyboardButton{
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Согласования"),
tgbotapi.NewKeyboardButton("Создать согласование"),
),
}
if isApprover {
rows = append(rows, tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Сформировать отчёт"),
tgbotapi.NewKeyboardButton("Делегирование прав"),
))
rows = append(rows, tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Добавить согласующего"),
))
}
rows = append(rows, tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("← Назад"),
))
return tgbotapi.NewReplyKeyboard(rows...)
}
// ApprovalsListSubmenuKeyboard - подменю "Список согласований"
func ApprovalsListSubmenuKeyboard() tgbotapi.ReplyKeyboardMarkup {
return tgbotapi.NewReplyKeyboard(
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Все"),
tgbotapi.NewKeyboardButton("Принятые"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Отклонённые"),
tgbotapi.NewKeyboardButton("На согласовании"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("← Назад"),
),
)
}
// ObserverMenuKeyboard - меню для наблюдателя
func ObserverMenuKeyboard() tgbotapi.ReplyKeyboardMarkup {
return tgbotapi.NewReplyKeyboard(
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Согласование"),
tgbotapi.NewKeyboardButton("Мои заявки"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Отложенные"),
tgbotapi.NewKeyboardButton("Наблюдаемые"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("❓ Как создать согласование"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Предложения и пожелания"),
),
)
}
// ApproverMenuKeyboard - меню для согласующего
func ApproverMenuKeyboard() tgbotapi.ReplyKeyboardMarkup {
return tgbotapi.NewReplyKeyboard(
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Согласование"),
tgbotapi.NewKeyboardButton("Мои заявки"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Согласовать"),
tgbotapi.NewKeyboardButton("Отложенные"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("❓ Как создать согласование"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Предложения и пожелания"),
),
)
}
// ApproverObserverMenuKeyboard - меню для согласующего + наблюдателя
func ApproverObserverMenuKeyboard() tgbotapi.ReplyKeyboardMarkup {
return tgbotapi.NewReplyKeyboard(
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Согласование"),
tgbotapi.NewKeyboardButton("Мои заявки"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Согласовать"),
tgbotapi.NewKeyboardButton("Отложенные"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Наблюдаемые"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("❓ Как создать согласование"),
),
tgbotapi.NewKeyboardButtonRow(
tgbotapi.NewKeyboardButton("Предложения и пожелания"),
),
)
}