bot

package
v0.1.33 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

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

func New

func New(token string, allowedUserID int64, s *store.Store) (*Bot, error)

func (*Bot) DeleteMessage

func (b *Bot) DeleteMessage(messageID int) error

DeleteMessage deletes a message from the conversation

func (*Bot) SendBPReminderNotification

func (b *Bot) SendBPReminderNotification(userID int64, enhanced bool) (int, error)

SendBPReminderNotification sends a BP reminder notification with action buttons

func (*Bot) SendExerciseList

func (b *Bot) SendExerciseList(sessionID int64, chatID int64) (int, error)

SendExerciseList sends an inline keyboard with all available exercises for a user Uses pagination to avoid Telegram keyboard limits (max 100 buttons)

func (*Bot) SendExercisePrompt

func (b *Bot) SendExercisePrompt(sessionID int64, exerciseID int64, exerciseName string, sets, repsMin int, repsMax *int, weightKg *float64) (int, error)

SendExercisePrompt sends a prompt for a specific exercise during workout

func (*Bot) SendGroupNotification

func (b *Bot) SendGroupNotification(meds []store.Medication, intakeByMedication map[int64]int64, target time.Time) (int, error)

func (*Bot) SendLowStockWarning

func (b *Bot) SendLowStockWarning(text string) error

SendLowStockWarning sends a low stock warning message to the user

func (*Bot) SendNotification

func (b *Bot) SendNotification(text string, intakeID int64, medicationID int64) (int, error)

func (*Bot) SendSimpleNotification

func (b *Bot) SendSimpleNotification(text string, buttons []tgbotapi.InlineKeyboardButton) (int, error)

SendSimpleNotification sends a notification with custom buttons SendSimpleNotification sends a notification with custom buttons

func (*Bot) SendWeightReminderNotification

func (b *Bot) SendWeightReminderNotification(userID int64) (int, error)

SendWeightReminderNotification sends a weight reminder notification with action buttons

func (*Bot) SendWorkoutComplete

func (b *Bot) SendWorkoutComplete(chatID, sessionID int64, completedExercises, totalExercises int) error

SendWorkoutComplete sends a completion message

func (*Bot) SendWorkoutNotification

func (b *Bot) SendWorkoutNotification(text string, sessionID int64) (int, error)

SendWorkoutNotification sends a workout notification with inline buttons

func (*Bot) SendWorkoutStaleNotification

func (b *Bot) SendWorkoutStaleNotification(text string, sessionID int64) (int, error)

SendWorkoutStaleNotification sends a notification for a stale workout with Finish and Dismiss buttons

func (*Bot) Start

func (b *Bot) Start()

func (*Bot) StartWorkoutFlowFromWeb added in v0.1.17

func (b *Bot) StartWorkoutFlowFromWeb(sessionID int64) error

StartWorkoutFlowFromWeb mirrors Telegram "Start" callback behavior when workout is started from web UI. It sends a confirmation message and exercise prompts with inline action buttons.

func (*Bot) UpdateWorkoutMessage added in v0.1.17

func (b *Bot) UpdateWorkoutMessage(msgID int, text string) error

UpdateWorkoutMessage updates a workout notification message

func (*Bot) Username

func (b *Bot) Username() string

Username returns the bot's username from the Telegram API

Jump to

Keyboard shortcuts

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