Files
tgex-backend/tg_bot/screens/platform_link.go
Artem Tsyrulnikov a92f33c22f правки
2026-02-01 14:36:09 +03:00

43 lines
1.1 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 screens
import (
"github.com/NicoNex/echotron/v3"
"github.com/TelegramExchange/tgex-backend/tg_bot/bot"
)
const msgPlatform = `
<b>🌐 Веб-платформа</b>
Управляйте проектами в браузере — удобно для работы с компьютера.
Полный функционал доступен на сайте.
`
type PlatformLink struct{}
func (s *PlatformLink) Enter(b *bot.Bot, mode bot.RenderMode) {
keyboard := Keyboard(
Row(URLButton("Открыть платформу", "https://example.com")),
Row(Button("↩ В главное меню", "main_menu")),
)
b.Render(msgPlatform, keyboard, mode)
}
func (s *PlatformLink) HandleCallback(b *bot.Bot, u *echotron.Update) {
switch u.CallbackQuery.Data {
case "main_menu":
b.SetState(&MainMenu{}, bot.EditMessage)
default:
s.Enter(b, bot.NewMessage)
}
}
func (s *PlatformLink) HandleMessage(b *bot.Bot, u *echotron.Update) {}
func (s *PlatformLink) Handle(b *bot.Bot, u *echotron.Update) {
b.SetState(&MainMenu{}, bot.NewMessage)
}
func (s *PlatformLink) Exit() {}