telegram

package
v0.0.0-...-c6f0891 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ask

func Ask(c tele.Context) (bool, error)

func CallbackData

func CallbackData(c tele.Context) error

func Day

func Day(c tele.Context) error

func EmptyStrAsNil

func EmptyStrAsNil(str string) *string

func ErrorHanler

func ErrorHanler(err error, c tele.Context)

func Escape

func Escape(msg string) string

func FormatDay

func FormatDay(c tele.Context, day *api.Day) string

func FormatDayShort

func FormatDayShort(c tele.Context, day *api.Day) string

func GetDateRange

func GetDateRange(days int, offset int, startFromMonday bool) (time.Time, time.Time)

func GetDayMarkup

func GetDayMarkup(c tele.Context, date string) *tele.ReplyMarkup

func GetMarkup

func GetMarkup(c tele.Context, markup *tele.ReplyMarkup) *tele.ReplyMarkup

func GetReplyKeyboard

func GetReplyKeyboard() [][]tele.ReplyButton

func GetSchedule

func GetSchedule(c tele.Context, start time.Time, end time.Time, filter bool) ([]api.Day, error)

func GetScheduleGroups

func GetScheduleGroups(c tele.Context, schedule []api.Day, start time.Time, end time.Time)

func GroupInRows

func GroupInRows(buttons []tele.Btn, perRow int) tele.ReplyMarkup

func HandleText

func HandleText(c tele.Context) error

func HelpMsg

func HelpMsg() string

func Init

func Init(token string, database *sql.DB)

func KeyboardMiddleware

func KeyboardMiddleware(next tele.HandlerFunc) tele.HandlerFunc

func LogAction

func LogAction(c tele.Context)

func LogError

func LogError(err error, c tele.Context)

func LogMiddleware

func LogMiddleware(next tele.HandlerFunc) tele.HandlerFunc

func Next

func Next(c tele.Context) error

func NextNext

func NextNext(c tele.Context) error

func NextWeek

func NextWeek(c tele.Context) error

func SendSchedule

func SendSchedule(c tele.Context, withGroups bool, formatter func(c tele.Context, day *api.Day) string, days int, offset int, startFromMonday bool) error

func SendSubject

func SendSubject(c tele.Context, discipline string) error

func SetCommands

func SetCommands(b *tele.Bot)

func SetData

func SetData(c tele.Context) error

func SetGroup

func SetGroup(c tele.Context) error

func Settings

func Settings(c tele.Context) error

func Short

func Short(c tele.Context) error

func Start

func Start(c tele.Context) error

func Subject

func Subject(c tele.Context) error

func UserMiddleware

func UserMiddleware(next tele.HandlerFunc) tele.HandlerFunc

func Week

func Week(c tele.Context) error

Types

type Command

type Command struct {
	Text        string
	Description string
	Handler     func(tele.Context) error
}

func GetCommands

func GetCommands() []Command

type Keyboard

type Keyboard [][]KeyboardButton

func GetKeyboard

func GetKeyboard() Keyboard

type KeyboardButton

type KeyboardButton struct {
	Text    string
	Handler func(tele.Context) error
}

Jump to

Keyboard shortcuts

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