нейминг кнопок

This commit is contained in:
Artem Tsyrulnikov
2026-01-19 19:24:34 +03:00
parent 2a4e694ca4
commit 7f6b2ac336
5 changed files with 23 additions and 24 deletions

View File

@@ -9,14 +9,14 @@ import (
"github.com/rs/zerolog/log"
)
type Purchases struct {
type Placements struct {
WorkspaceID string
ProjectID string
ProjectTitle string
BackState bot.State
}
func (s *Purchases) Enter(b *bot.Bot, mode bot.RenderMode) {
func (s *Placements) Enter(b *bot.Bot, mode bot.RenderMode) {
jwt := b.Session.JWT
if jwt == "" {
log.Error().Msg("JWT is empty in session")
@@ -27,7 +27,7 @@ func (s *Purchases) Enter(b *bot.Bot, mode bot.RenderMode) {
s.renderPurchases(b, mode, jwt)
}
func (s *Purchases) renderPurchases(b *bot.Bot, mode bot.RenderMode, jwt string) {
func (s *Placements) renderPurchases(b *bot.Bot, mode bot.RenderMode, jwt string) {
resp, err := b.Backend.GetPlacements(
context.Background(),
jwt,
@@ -93,7 +93,7 @@ func (s *Purchases) renderPurchases(b *bot.Bot, mode bot.RenderMode, jwt string)
b.Render(text, keyboard, mode)
}
func (s *Purchases) HandleCallback(b *bot.Bot, u *echotron.Update) {
func (s *Placements) HandleCallback(b *bot.Bot, u *echotron.Update) {
if u.CallbackQuery == nil || u.CallbackQuery.Data == "" {
return
}
@@ -131,8 +131,8 @@ func (s *Purchases) HandleCallback(b *bot.Bot, u *echotron.Update) {
}
}
func (s *Purchases) HandleMessage(_ *bot.Bot, _ *echotron.Update) { return }
func (s *Placements) HandleMessage(_ *bot.Bot, _ *echotron.Update) { return }
func (s *Purchases) Handle(_ *bot.Bot, _ *echotron.Update) { return }
func (s *Placements) Handle(_ *bot.Bot, _ *echotron.Update) { return }
func (s *Purchases) Exit() {}
func (s *Placements) Exit() {}