bot

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package bot implements the Telegram bot functionality for expense tracking.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBudgetKeyboard

func GetBudgetKeyboard() tgbotapi.InlineKeyboardMarkup

GetBudgetKeyboard returns the budget management keyboard

func GetCategoryGroupKeyboard

func GetCategoryGroupKeyboard(categories []*models.Category) tgbotapi.InlineKeyboardMarkup

GetCategoryGroupKeyboard returns the category group keyboard

func GetCategoryKeyboard

func GetCategoryKeyboard() tgbotapi.InlineKeyboardMarkup

GetCategoryKeyboard returns the category group keyboard

func GetConfirmationKeyboard

func GetConfirmationKeyboard() tgbotapi.InlineKeyboardMarkup

GetConfirmationKeyboard returns the confirmation keyboard

func GetDeleteExpenseKeyboard

func GetDeleteExpenseKeyboard(expenses []*models.Expense) tgbotapi.InlineKeyboardMarkup

GetDeleteExpenseKeyboard returns the delete expense selection keyboard

func GetEditExpenseKeyboard

func GetEditExpenseKeyboard(expenses []*models.Expense) tgbotapi.InlineKeyboardMarkup

GetEditExpenseKeyboard returns the edit expense selection keyboard

func GetEditFieldKeyboard

func GetEditFieldKeyboard() tgbotapi.InlineKeyboardMarkup

GetEditFieldKeyboard returns the edit field selection keyboard

func GetMainMenuKeyboard

func GetMainMenuKeyboard() tgbotapi.ReplyKeyboardMarkup

GetMainMenuKeyboard returns the main menu keyboard

func GetReminderKeyboard

func GetReminderKeyboard() tgbotapi.InlineKeyboardMarkup

GetReminderKeyboard returns the reminder management keyboard

func GetReportKeyboard

func GetReportKeyboard() tgbotapi.InlineKeyboardMarkup

GetReportKeyboard returns the report selection keyboard

func GetSettingsKeyboard

func GetSettingsKeyboard() tgbotapi.InlineKeyboardMarkup

GetSettingsKeyboard returns the settings keyboard

Types

type Bot

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

Bot represents the Telegram bot

func NewBot

func NewBot(ctx context.Context, token string, dbClient database.Storage, logger logger.Logger) (*Bot, error)

NewBot creates a new bot instance

func (*Bot) GetMetrics

func (b *Bot) GetMetrics() map[string]any

GetMetrics returns the current metrics

func (*Bot) HandleUpdate

func (b *Bot) HandleUpdate(ctx context.Context, update *tgbotapi.Update) error

HandleUpdate processes incoming updates from Telegram

func (*Bot) Start

func (b *Bot) Start(ctx context.Context) error

Start starts the bot

Jump to

Keyboard shortcuts

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