telegram

package
v0.0.0-...-1bd92a5 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Options(
	fx.Provide(provideTelegramBot),
	fx.Invoke(func(b *Bot) {}),
)

Functions

func NewTelegramNotifier

func NewTelegramNotifier(ctx tele.Context) application.Notifier

Types

type Bot

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

func NewBot

func NewBot(p BotParams) (*Bot, error)

func (*Bot) Run

func (b *Bot) Run()

func (*Bot) Stop

func (b *Bot) Stop()

type BotParams

type BotParams struct {
	fx.In
	Token    BotToken
	Handlers Handlers
	Admins   TelegramAdmins
}

type BotToken

type BotToken string

type Handlers

type Handlers struct {
	fx.In
	StartCommandHandler StartCommandHandler
	TextHandler         TextHandler
	InlineQueryHandler  InlineQueryHandler
	InlineResultHandler InlineResultHandler
}

type InlineQueryHandler

type InlineQueryHandler struct {
	fx.In
	Logger logging.Logger
	Repo   application.TorrentRepository
}

func (*InlineQueryHandler) Handle

func (h *InlineQueryHandler) Handle(c tele.Context) error

type InlineResultHandler

type InlineResultHandler struct {
	fx.In
	Logger  logging.Logger
	Usecase application.DownloadTorrentUsecase
}

func (*InlineResultHandler) Handle

func (h *InlineResultHandler) Handle(c tele.Context) error

type StartCommandHandler

type StartCommandHandler struct {
	fx.In
	Logger logging.Logger
}

func (*StartCommandHandler) Handle

func (h *StartCommandHandler) Handle(c tele.Context) error

type TelegramAdmins

type TelegramAdmins []TelegramUserId

type TelegramUserId

type TelegramUserId int64

type TextHandler

type TextHandler struct {
	fx.In
	Logger logging.Logger
	Repo   application.TorrentRepository
}

func (*TextHandler) Handle

func (h *TextHandler) Handle(c tele.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳