telegram_processor

package
v0.0.0-...-35a4376 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorHandlerAlreadySet = errors.New("handler already set")
	ErrorHandlerNotSet     = errors.New("handler not set")
)

Functions

This section is empty.

Types

type BotConfig

type BotConfig struct {
	BotAPIToken   string        `json:"bot_api_token"`
	UpdateTimeout time.Duration `json:"update_timeout"`
}

func (BotConfig) ValidateConfigFields

func (c BotConfig) ValidateConfigFields() error

type CallbackQueryHandlerFunction

type CallbackQueryHandlerFunction func(ctx context.Context, message *tgbotapi.CallbackQuery) error

type ChatJoinRequestHandlerFunction

type ChatJoinRequestHandlerFunction func(ctx context.Context, message *tgbotapi.ChatJoinRequest) error

type ChatMemberHandlerFunction

type ChatMemberHandlerFunction func(ctx context.Context, message *tgbotapi.ChatMemberUpdated) error

type ChosenInlineResultHandlerFunction

type ChosenInlineResultHandlerFunction func(ctx context.Context, message *tgbotapi.ChosenInlineResult) error

type InlineQueryHandlerFunction

type InlineQueryHandlerFunction func(ctx context.Context, message *tgbotapi.InlineQuery) error

type MessageHandlerFunction

type MessageHandlerFunction func(ctx context.Context, message *tgbotapi.Message) error

type PollAnswerHandlerFunction

type PollAnswerHandlerFunction func(ctx context.Context, message *tgbotapi.PollAnswer) error

type PollHandlerFunction

type PollHandlerFunction func(ctx context.Context, message *tgbotapi.Poll) error

type PreCheckoutQueryHandlerFunction

type PreCheckoutQueryHandlerFunction func(ctx context.Context, message *tgbotapi.PreCheckoutQuery) error

type Processor

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

func NewProcessor

func NewProcessor(
	botConfig BotConfig,
	tracer tracing.Tracer,
	meter metrics.Meter,
	logger log.Logger,
) (*Processor, error)

func (*Processor) Delete

func (p *Processor) Delete(chattable tgbotapi.Chattable) error

func (*Processor) GetFile

func (p *Processor) GetFile(ctx context.Context, fileID string) (io.ReadCloser, error)

func (Processor) HandleCallbackQuery

func (h Processor) HandleCallbackQuery(handler CallbackQueryHandlerFunction) error

func (Processor) HandleChannelPost

func (h Processor) HandleChannelPost(handler MessageHandlerFunction) error

func (Processor) HandleChatJoinRequest

func (h Processor) HandleChatJoinRequest(handler ChatJoinRequestHandlerFunction) error

func (Processor) HandleChatMember

func (h Processor) HandleChatMember(handler ChatMemberHandlerFunction) error

func (Processor) HandleChosenInlineResult

func (h Processor) HandleChosenInlineResult(handler ChosenInlineResultHandlerFunction) error

func (Processor) HandleCommand

func (h Processor) HandleCommand(handler MessageHandlerFunction) error

func (Processor) HandleEditedChannelPost

func (h Processor) HandleEditedChannelPost(handler MessageHandlerFunction) error

func (Processor) HandleEditedMessage

func (h Processor) HandleEditedMessage(handler MessageHandlerFunction) error

func (Processor) HandleInlineQuery

func (h Processor) HandleInlineQuery(handler InlineQueryHandlerFunction) error

func (Processor) HandleMessage

func (h Processor) HandleMessage(handler MessageHandlerFunction) error

func (Processor) HandleMyChatMember

func (h Processor) HandleMyChatMember(handler ChatMemberHandlerFunction) error

func (Processor) HandlePoll

func (h Processor) HandlePoll(handler PollHandlerFunction) error

func (Processor) HandlePollAnswer

func (h Processor) HandlePollAnswer(handler PollAnswerHandlerFunction) error

func (Processor) HandlePreCheckoutQuery

func (h Processor) HandlePreCheckoutQuery(handler PreCheckoutQueryHandlerFunction) error

func (Processor) HandleShippingQuery

func (h Processor) HandleShippingQuery(handler ShippingQueryHandlerFunction) error

func (*Processor) Request

func (p *Processor) Request(chattable tgbotapi.Chattable) (*tgbotapi.APIResponse, error)

func (*Processor) SendChattable

func (p *Processor) SendChattable(chattable tgbotapi.Chattable) (tgbotapi.Message, error)

func (*Processor) SendMediaGroup

func (p *Processor) SendMediaGroup(mediaGroupConfig tgbotapi.MediaGroupConfig) ([]tgbotapi.Message, error)

func (*Processor) Start

func (p *Processor) Start()

func (*Processor) StartAsync

func (p *Processor) StartAsync()

func (*Processor) Stop

func (p *Processor) Stop()

type ShippingQueryHandlerFunction

type ShippingQueryHandlerFunction func(ctx context.Context, message *tgbotapi.ShippingQuery) error

Jump to

Keyboard shortcuts

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