telegram

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyboardMain = iota
	KeyboardOther
)

Variables

This section is empty.

Functions

func AskCourse

func AskCourse(c tele.Context) error

func AskFaculty

func AskFaculty(c tele.Context) error

func AskForm

func AskForm(c tele.Context) error

func AskGroup

func AskGroup(c tele.Context) error

func BanMiddleware

func BanMiddleware(next tele.HandlerFunc) tele.HandlerFunc

func CallbackDataHandler

func CallbackDataHandler(c tele.Context) error

func DayHandler

func DayHandler(c tele.Context) error

func DeleteMessage

func DeleteMessage(c tele.Context) error

func EmptyStrAsNil

func EmptyStrAsNil(str string) *string

func ErrorHandler

func ErrorHandler(err error, c tele.Context)

func Escape

func Escape(msg string) string

func FormatDay

func FormatDay(c tele.Context, day *api.Day, withGroups bool) []string

func FormatDayShort

func FormatDayShort(_ tele.Context, day *api.Day, _ bool) []string

func GetDateRange

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

func GetDayMarkup

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

func GetReplyKeyboard

func GetReplyKeyboard(keyboardIndex int) [][]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 GetTeacherDayMarkup

func GetTeacherDayMarkup(c tele.Context, employee string, date string, messageIdsToDelete []string) *tele.ReplyMarkup

func GroupInRows

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

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 MainHandler

func MainHandler(c tele.Context) error

func MetricWriteMessage

func MetricWriteMessage(metric *db.Metric, message *tele.Message)

func MetricsMiddleware

func MetricsMiddleware(next tele.HandlerFunc) tele.HandlerFunc

func NextHandler

func NextHandler(c tele.Context) error

func NextNextHandler

func NextNextHandler(c tele.Context) error

func NextWeekHandler

func NextWeekHandler(c tele.Context) error

func OtherHandler

func OtherHandler(c tele.Context) error

func SearchGroupHandler

func SearchGroupHandler(c tele.Context) error

func SearchTeacherHandler

func SearchTeacherHandler(c tele.Context) error

func SendSchedule

func SendSchedule(c tele.Context, message *tele.Message, withGroups bool, formatter Formatter, start time.Time, end time.Time) error

func SendScheduleWithOptions

func SendScheduleWithOptions(c tele.Context, withGroups bool, formatter Formatter, days int, offset int, startFromMonday bool) error

func SendSubject

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

func SetSearchTeacherHandler

func SetSearchTeacherHandler(c tele.Context) error

func SettingsHandler

func SettingsHandler(c tele.Context) error

func ShortHandler

func ShortHandler(c tele.Context) error

func StartHandler

func StartHandler(c tele.Context) error

func SubjectHandler

func SubjectHandler(c tele.Context) error

func TextHandler

func TextHandler(c tele.Context) error

func UserMiddleware

func UserMiddleware(next tele.HandlerFunc) tele.HandlerFunc

func WeekHandler

func WeekHandler(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 Formatter

type Formatter func(c tele.Context, day *api.Day, withGroups bool) []string

type Keyboard

type Keyboard [][]KeyboardButton

func GetKeyboards

func GetKeyboards() []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