util

package
v0.0.0-...-ae6f334 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func After

func After(value string, key string) string

After returns the substring after the first instance of the key

func BotDeleteMessage

func BotDeleteMessage(bot *tgbotapi.BotAPI, chatId int64, messageId int)

func BotSendMessage

func BotSendMessage(bot *tgbotapi.BotAPI, chatId int64, message string)

func BotSendWrapper

func BotSendWrapper(bot *tgbotapi.BotAPI, chattables ...tgbotapi.Chattable)

func GetFloatFormatter

func GetFloatFormatter(currency money.Currency) string

func NewEditEmptyInlineKeyboard

func NewEditEmptyInlineKeyboard(chatId int64, messageId int) tgbotapi.EditMessageReplyMarkupConfig

func NewInlineKeyboard

func NewInlineKeyboard(configs []InlineKeyboardConfig, messageContextId int, colSize int, cancellable bool) [][]tgbotapi.InlineKeyboardButton

func NewPaginationKeyboard

func NewPaginationKeyboard(totalCount int, currentOffset int, limit int, messageContextId int, colSize int) ([][]tgbotapi.InlineKeyboardButton, error)

func NewUndoConfirmationKeyboard

func NewUndoConfirmationKeyboard(transactionId int, messageContextId int, colSize int) ([][]tgbotapi.InlineKeyboardButton, error)

func ParseMonthFromString

func ParseMonthFromString(s string) time.Month

ParseMonthFromString trys to return the month given a string, else it returns the current month.

func ParseMonthYearFromMessage

func ParseMonthYearFromMessage(s string) (time.Month, int)

parseMonthYearFromMessage returns the month and year representation from the string, any error returns the current month or year

func ToJson

func ToJson[T any](t T) (string, error)

Types

type InlineKeyboardConfig

type InlineKeyboardConfig struct {
	// contains filtered or unexported fields
}

func NewInlineKeyboardConfig

func NewInlineKeyboardConfig(label string, data string) InlineKeyboardConfig

type YearMonth

type YearMonth struct {
	Month time.Month
	Year  int
}

func (YearMonth) String

func (ym YearMonth) String(layout string) (string, error)

Jump to

Keyboard shortcuts

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