api

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

Controller handles incoming Telegram updates and orchestrates responses.

func NewController

func NewController(b *telebot.Bot) *Controller

NewController creates a new Controller instance. NewController creates a new instance of the Controller. It initializes the URL parsing regex.

func (*Controller) OnStart

func (*Controller) OnStart(c telebot.Context) error

OnStart is the entry point for the incoming update OnStart handles the /start command, sending a welcome message in private chats.

func (*Controller) OnText

func (x *Controller) OnText(c telebot.Context) error

OnText handles incoming text messages. It extracts URLs from the message text and processes them. If no links are found, it sends an error message in private chats.

Jump to

Keyboard shortcuts

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