telegram

package
v0.0.0-...-cf2bb25 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessChecker

type AccessChecker interface {
	// CheckAccess checks access to telegram chat and returns true if access is granted.
	CheckAccess(id int64, username string) bool
}

AccessChecker checks access to telegram chats.

type Options

type Options struct {
	Token         string           // Telegram bot token.
	GPT           *gpt.GPT         // GPT text transformer.
	AccessChecker AccessChecker    // Access checker.
	Storage       *storage.Storage // Storage.
}

Options is a telegram bot options.

type Telegram

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

Telegram is a telegram bot.

func New

func New(options Options) (*Telegram, error)

New creates a new telegram bot.

func (*Telegram) Close

func (tg *Telegram) Close()

Close shuts telegram bot down.

func (*Telegram) Run

func (tg *Telegram) Run(ctx context.Context)

Run runs telegram bot in foreground until context is canceled.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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