db

package
v0.0.0-...-92b9fce Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Mysql_connection string
	DB               *sql.DB

	ErrUserExists = errors.New("User exists")
	TGToken       string
)

Functions

func AddNewExercise

func AddNewExercise(userID int64, repsName string) error

func AddUser

func AddUser(userID int64, userName string) error

func ClearTodayProgress

func ClearTodayProgress(userID int64, repsName string) error

func ClearTodayProgressAll

func ClearTodayProgressAll(userID int64) error

func GetRepsID

func GetRepsID(userID int64, repsName string) int

func GetTodaysAmount

func GetTodaysAmount(userID int64, repsName string) int

func GetUserDate

func GetUserDate(userID int64) string

func GetUserName

func GetUserName(userID int64) string

func IfButton

func IfButton(userID int64, textToCheck string) bool

IfButton checks if the message of user is one of the buttons or not. If not, false will be returned

func Increment

func Increment(userID int64, reps int, repsName string) (int, error)

func UserExists

func UserExists(userID int64) bool

func UserKeyboard

func UserKeyboard(userID int64) tgbotapi.ReplyKeyboardMarkup

UserKeyboard generates the telegram keyboard according to exercises he has added. Also there are default buttons

func UserRepsAmount

func UserRepsAmount(userID int64, repsName string) (int, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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