Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Downloader ¶
type MessageHandler ¶
type MessageHandler struct {
// contains filtered or unexported fields
}
func NewMessageHandler ¶
func NewMessageHandler(bot *tgbotapi.BotAPI, dl Downloader, l zerolog.Logger) *MessageHandler
func (*MessageHandler) Handle ¶
func (h *MessageHandler) Handle(msg *tgbotapi.Message) error
Handle processes an incoming Telegram message. Plain-text messages are treated as media URLs: the URL is downloaded via the Downloader, and the resulting files are sent back to the same chat as a media group (up to 10 items per batch). Files that exceed the 50 MB Telegram bot upload limit are skipped with a notice to the user. Bot commands are handled separately — /start sends a welcome message; unknown commands are silently ignored. Returns an error only for unexpected I/O failures; Telegram API errors are logged and swallowed so the update loop can continue.
Click to show internal directories.
Click to hide internal directories.