telegram

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PollerTimeout is the default timeout for the bot poller.
	PollerTimeout = 10 * time.Second
	// VLANSelectCacheSize is the default size of the VLAN select cache.
	VLANSelectCacheSize = 100
	// RandomIDLength is the default length of the random IDs.
	RandomIDLength = 32
)

Variables

View Source
var ErrFailedToReadData = fmt.Errorf("failed to read data from message")

ErrFailedToReadData is returned when the data from the message could not be read.

Functions

This section is empty.

Types

type BotServer

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

BotServer is a Telegram bot server.

func NewBotServer

func NewBotServer(ctx context.Context, cfg *config.Config, db database.Database) (*BotServer, error)

NewBotServer creates a new BotServer.

func (*BotServer) NotifyLoginAttempt

func (bs *BotServer) NotifyLoginAttempt(username, password, macAddress string)

NotifyLoginAttempt sends a message to all the chat IDs when a login attempt is detected.

func (*BotServer) StartBot

func (bs *BotServer) StartBot(ctx context.Context) error

StartBot starts the Telegram bot.

Jump to

Keyboard shortcuts

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