tgbot

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

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

func Init

func Init(settings Settings) (*Bot, error)

func (*Bot) Queue

func (b *Bot) Queue(ctx context.Context, ch chan error)

Queue runtimeBotQueue processes an updates from queue

func (*Bot) SendMessage

func (b *Bot) SendMessage(messages SendData) ([]SentResult, error)

func (*Bot) UpdatesGet

func (b *Bot) UpdatesGet(ctx context.Context, ch chan error)

UpdatesGet runtimeBotUpdates checks updates at Telegram and put it into queue

type FeedbackSettings

type FeedbackSettings struct {
	ProjectID int64
	UserID    int64
}

type SendData

type SendData struct {
	Rcpts []SendRcptData
	Files []SendFileData
}

type SendFileData

type SendFileData struct {
	Reader      io.Reader
	Name        string
	Caption     string
	ContentType string
}

type SendRcptData

type SendRcptData struct {
	ChatID  int64
	Message string
}

type SentResult

type SentResult struct {
	ChatID     int64
	MessageIDs []int64
}

type Settings

type Settings struct {
	APIToken   string
	Log        *logrus.Logger
	Cache      cache.Cache
	RedisHost  string
	LangBundle localization.Bundle
	Feedback   *FeedbackSettings
	Issues     issues.Issues
	Users      users.Users
}

Jump to

Keyboard shortcuts

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