telegram

package
v0.1.62 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminTelegramService added in v0.1.52

type AdminTelegramService interface {
	BindFromWebhook(ctx context.Context, verifyCode string, telegramUserID int64, telegramUsername string) (any, error)
	UnbindByTelegramID(ctx context.Context, telegramUserID int64) error
	GetBindingByTelegramID(ctx context.Context, telegramUserID int64) (any, error)
}

AdminTelegramService defines the interface for admin telegram binding

type CallbackAnswerer added in v0.1.52

type CallbackAnswerer interface {
	AnswerCallbackQuery(callbackQueryID string, text string, showAlert bool) error
	EditMessageWithInlineKeyboard(chatID int64, messageID int64, text string, keyboard any) error
	EditMessageReplyMarkup(chatID int64, messageID int64, keyboard any) error
}

CallbackAnswerer defines the interface for answering Telegram callback queries

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler handles telegram-related HTTP requests

func NewHandler

func NewHandler(service *telegramApp.ServiceDDD, logger logger.Interface, webhookSecret string) *Handler

NewHandler creates a new telegram handler

func (*Handler) GetBindingStatus

func (h *Handler) GetBindingStatus(c *gin.Context)

GetBindingStatus returns the current telegram binding status GET /telegram/binding

func (*Handler) HandleWebhook

func (h *Handler) HandleWebhook(c *gin.Context)

HandleWebhook handles Telegram webhook updates POST /webhooks/telegram

func (*Handler) SetAdminService added in v0.1.52

func (h *Handler) SetAdminService(adminService AdminTelegramService)

SetAdminService sets the admin telegram service (optional dependency injection)

func (*Handler) SetCallbackAnswerer added in v0.1.52

func (h *Handler) SetCallbackAnswerer(answerer CallbackAnswerer)

SetCallbackAnswerer sets the callback answerer (optional dependency injection)

func (*Handler) SetMuteService added in v0.1.52

func (h *Handler) SetMuteService(muteService MuteNotificationService)

SetMuteService sets the mute notification service (optional dependency injection)

func (*Handler) SetWebhookSecretProvider added in v0.1.52

func (h *Handler) SetWebhookSecretProvider(provider WebhookSecretProvider)

SetWebhookSecretProvider sets the provider for hot-reloadable webhook secret

func (*Handler) Unbind

func (h *Handler) Unbind(c *gin.Context)

Unbind removes the telegram binding DELETE /telegram/binding

func (*Handler) UpdatePreferences

func (h *Handler) UpdatePreferences(c *gin.Context)

UpdatePreferences updates notification preferences PATCH /telegram/preferences

type MuteNotificationService added in v0.1.52

type MuteNotificationService interface {
	MuteAgentNotification(ctx context.Context, agentSID string) error
	MuteNodeNotification(ctx context.Context, nodeSID string) error
	UnmuteAgentNotification(ctx context.Context, agentSID string) error
	UnmuteNodeNotification(ctx context.Context, nodeSID string) error
}

MuteNotificationService defines the interface for muting resource notifications

type WebhookSecretProvider added in v0.1.52

type WebhookSecretProvider interface {
	GetWebhookSecret(ctx context.Context) string
}

WebhookSecretProvider provides webhook secret with hot-reload support

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL