telegram

package
v0.0.0-...-073df37 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 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 BanMiddleware

func BanMiddleware(next tele.HandlerFunc) tele.HandlerFunc

func CallbackData

func CallbackData(c tele.Context) error

func Day

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

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

func MetricsMiddleware

func MetricsMiddleware(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, 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 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 Formatter

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

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