Versions in this module Expand all Collapse all v2 v2.3.0 Feb 4, 2024 v2.2.0 Aug 19, 2023 Changes in this version + const CMD_ADM_CRON + const CMD_ADM_NOTIFY + const CMD_ARCHIVE_ALL + const CMD_CANCEL + const CMD_CONFIG + const CMD_DELETE_ALL + const CMD_HELP + const CMD_LIST + const CMD_SIMPLE + const CMD_START + const CMD_SUGGEST + const DEBUG + const ERROR + const FATAL + const FORMATTER_PLACEHOLDER + const INFO + const MSG_UNFINISHED_STATE + const TEMPLATE_SIMPLE_DEFAULT + const TRACE + const WARN + var CMD_COMMENT = []string + var CMD_TEMPLATE = []string + var TEMPLATE_TYPE_HINTS = map[Type]HintTemplate + func HandleFloat(m *tb.Message) (string, error) + func HandleRaw(m *tb.Message) (string, error) + func ParseAmount(f float64) string + func ParseDate(m string) (string, error) + func Recipient(m *tb.Message) tb.Recipient + func ReplyKeyboard(buttons []string) *tb.ReplyMarkup + type Bot struct + func (b *Bot) Handle(endpoint interface{}, handler tb.HandlerFunc, m ...tb.MiddlewareFunc) + func (b *Bot) Me() *tb.User + func (b *Bot) Respond(c *tb.Callback, resp ...*tb.CallbackResponse) error + func (b *Bot) Send(to tb.Recipient, what interface{}, options ...interface{}) (*tb.Message, error) + func (b *Bot) SendSilent(...) (*tb.Message, error) + func (b *Bot) Start() + type BotController struct + Bot IBot + CronScheduler *gocron.Scheduler + Repo *crud.Repo + State *StateHandler + func NewBotController(db dbWrapper.DB) *BotController + func (bc *BotController) AddBotAndStart(b IBot) + func (bc *BotController) ConfigureCronScheduler() *BotController + func (bc *BotController) DeleteUserData(m *tb.Message) + func (bc *BotController) Logf(level helpers.Level, m *tb.Message, format string, v ...interface{}) + func (bc *BotController) MergeMessagesHonorSendLimit(m []string, sep string) []string + type CMD struct + CommandAlias []string + Handler tb.HandlerFunc + Help string + Optional []string + type Hint struct + KeyboardOptions []string + Prompt string + type HintTemplate struct + Handler func(m *tb.Message) (string, error) + Text string + type IBot interface + Handle func(endpoint interface{}, h tb.HandlerFunc, m ...tb.MiddlewareFunc) + Me func() *tb.User + Respond func(c *tb.Callback, resp ...*tb.CallbackResponse) error + Send func(to tb.Recipient, what interface{}, options ...interface{}) (*tb.Message, error) + SendSilent func(...) (*tb.Message, error) + Start func() + func CreateBot(bc *BotController) IBot + type Input struct + type NumberConfig struct + Fraction int + IsNegative bool + type ReceiverImpl struct + ChatId string + func (r ReceiverImpl) Recipient() string + type Sender struct + func (s Sender) Recipient() string + type SimpleTx struct + func (tx *SimpleTx) CacheData() (data map[string]string) + func (tx *SimpleTx) Debug() string + func (tx *SimpleTx) EnrichHint(r *crud.Repo, m *tb.Message, i *Input) *Hint + func (tx *SimpleTx) FillTemplate(currency, tag string, tzOffset int) (string, error) + func (tx *SimpleTx) Input(m *tb.Message) (isDone bool, err error) + func (tx *SimpleTx) IsDone() bool + func (tx *SimpleTx) NextHint(r *crud.Repo, m *tb.Message) *Hint + func (tx *SimpleTx) Prepare() Tx + func (tx *SimpleTx) SetDate(d string) (Tx, error) + type StateHandler struct + func NewStateHandler() *StateHandler + func (s *StateHandler) Clear(m *tb.Message) + func (s *StateHandler) CountOpen() int + func (s *StateHandler) GetTx(m *tb.Message) Tx + func (s *StateHandler) GetType(m *tb.Message) StateType + func (s *StateHandler) SimpleTx(m *tb.Message, suggestedCur string) (Tx, error) + func (s *StateHandler) StartTpl(m *tb.Message, name string) + func (s *StateHandler) TemplateTx(m *tb.Message, template, suggestedCur, date string) (Tx, error) + type StateType string + const ST_NONE + const ST_TPL + const ST_TX + type TemplateField struct + func ParseTemplateField(rawField, currencySuggestion string) *TemplateField + func ParseTemplateFields(template, currencySuggestion string) []*TemplateField + func SortTemplateFields(unsortedFields []*TemplateField) []*TemplateField + func (tf *TemplateField) FieldIdentifierForValue() string + type TemplateHintData struct + FieldDefault string + FieldHint string + FieldName string + FieldSpecifier string + Raw string + type TemplateName string + type TemplateTx struct + type Tx interface + CacheData func() map[string]string + Debug func() string + EnrichHint func(r *crud.Repo, m *tb.Message, i *Input) *Hint + FillTemplate func(currency, tag string, tzOffset int) (string, error) + Input func(*tb.Message) (bool, error) + IsDone func() bool + NextHint func(*crud.Repo, *tb.Message) *Hint + Prepare func() Tx + SetDate func(string) (Tx, error) + func CreateSimpleTx(suggestedCur, template string) (Tx, error) + type Type string Other modules containing this package github.com/LucaBernstein/beancount-bot-tg