telegram

package
v0.0.0-...-2e84850 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowedChatsMiddleware

func AllowedChatsMiddleware(chatIDs map[int64]struct{}, log Logger) func(next tb.HandlerFunc) tb.HandlerFunc

func NewTelebot

func NewTelebot(token string) (*tb.Bot, error)

Types

type Bot

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

func NewBot

func NewBot(deps Dependencies) *Bot

func (*Bot) Start

func (b *Bot) Start(bot *tb.Bot)

type Dependencies

type Dependencies struct {
	AllowedChats              []int64
	YNAB                      YNABDependencies
	StatisticMessageFormatter StatisticMessageFormatter
	Logger                    Logger
}

type Logger

type Logger interface {
	Infow(msg string, keysAndValues ...interface{})
	Warnw(msg string, keysAndValues ...interface{})
	Errorw(msg string, keysAndValues ...interface{})
}

type StatisticMessageFormatter

type StatisticMessageFormatter func(cat budget.GeneralCategoryStatistic) (string, error)

func NewDefaultStatisticMessageFormatter

func NewDefaultStatisticMessageFormatter() (StatisticMessageFormatter, error)

type YNABClient

type YNABClient interface {
	GetCategory(ctx context.Context, budgetID, categoryID string) (*ynab.Category, error)
}

type YNABDependencies

type YNABDependencies struct {
	BudgetID   string
	CategoryID string
	Client     YNABClient
}

Jump to

Keyboard shortcuts

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