foodbot

package
v0.0.0-...-9290f5a Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 9 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
}

Bot stores all the information and connection to the database.

func NewBot

func NewBot(dbPath string) (*Bot, error)

NewBot connects to the given DB and loads all stored information for the foodbot.

func (*Bot) AddProduct

func (b *Bot) AddProduct(name string, kcal uint32)

AddProduct adds a new energy value for the given product.

func (*Bot) RespondTo

func (b *Bot) RespondTo(msg *tgbotapi.Message) tgbotapi.MessageConfig

RespondTo the given message from the user.

func (*Bot) RespondToKeyboard

func (b *Bot) RespondToKeyboard(msg *tgbotapi.CallbackQuery) tgbotapi.EditMessageTextConfig

RespondToKeyboard the given message from the user.

func (*Bot) Stop

func (b *Bot) Stop()

Stop connection to the database.

Jump to

Keyboard shortcuts

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