handler

package
v1.21.3 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package handler holds the Hertz handler of the Telegram bot webhook.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterTelegramHandlers

func RegisterTelegramHandlers(router *server.Hertz, service notification.Service, botToken func() string)

RegisterTelegramHandlers registers the Telegram bot webhook; botToken reads the current bot token, which the webhook secret derives from.

func TelegramHandler

func TelegramHandler(service WebhookUpdates, botToken func() string) app.HandlerFunc

TelegramHandler documents Telegram.

@Summary Telegram @Tags common @Accept json @Produce json @Security TelegramSecret @Param request body object true "Telegram Bot API update" @Success 200 {object} httpx.ResponseSuccessBean @Router /v1/telegram/webhook [post]

Types

type WebhookUpdates added in v1.21.0

type WebhookUpdates interface {
	HandleTelegramWebhook(ctx context.Context, payload []byte) error
}

WebhookUpdates is the part of the notification facade the webhook feeds: it decodes and handles one update.

Jump to

Keyboard shortcuts

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