bot

package
v0.0.0-...-838b5ba Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageHelp = `` /* 340-byte string literal not displayed */

)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

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

func New

func New(options ...Options) (*Bot, error)

func (*Bot) ChangeSource

func (b *Bot) ChangeSource(ctx context.Context, userID int, newSource models.Source) (string, interface{}, error)

func (*Bot) GetUpdatesChan

func (b *Bot) GetUpdatesChan() (tgbotapi.UpdatesChannel, error)

func (*Bot) MessageHandler

func (b *Bot) MessageHandler(ctx context.Context, update tgbotapi.Update) (tgbotapi.Message, error)

func (*Bot) RandomPost

func (b *Bot) RandomPost(ctx context.Context, userID int) (string, error)

func (*Bot) TopPosts

func (b *Bot) TopPosts(ctx context.Context, userID int) (string, error)

type DefaultHTTPClient

type DefaultHTTPClient struct {
	*http.Client
}

func NewHTTPClient

func NewHTTPClient() *DefaultHTTPClient

func (*DefaultHTTPClient) Get

func (c *DefaultHTTPClient) Get(ctx context.Context, url string) (*http.Response, error)

func (*DefaultHTTPClient) Post

func (c *DefaultHTTPClient) Post(ctx context.Context, url, contentType string, body io.Reader) (*http.Response, error)

type Options

type Options struct {
	Config     config.Config
	BotAPI     *tgbotapi.BotAPI
	HTTPClient interfaces.HTTPClient
	Storage    interfaces.Storage
	RandomInt  func(n int) int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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