Documentation ¶
Index ¶
- Constants
- Variables
- func Bold(s string) string
- func Escape(s string) string
- func Escapef(format string, a ...any) string
- func FormatCommandHelp(cmd commandtypes.Desc) string
- func FormatCommandShortHelp(cmd commandtypes.Desc) string
- func FormatCommandUsage(cmd commandtypes.Desc) string
- func FormatHelp(cmds []commandtypes.Desc) string
- func FormatMessageCreated(id string) string
- func FormatMessages(header string, msgs []*standup.Message) string
- func FormatStart() string
- func Mono(s string) string
- func MustRenderTemplate(tmpl string, data any) string
- func ParseTime(s string, now time.Time) (time.Time, error)
- func RenderTemplate(tmpl string, data any) (string, error)
- type Printable
- type SyntaxError
Constants ¶
View Source
const ParseMode = tgbotapi.ModeMarkdownV2
Variables ¶
View Source
var ( InternalError = Escape("Internal error occured.") PermissionDenied = Escape("Permission denied.") UsageRestricted = Escape("Bot usage is currently restricted.") )
View Source
var ErrInvalidTimeFormat = errors.New("invalid time format")
Functions ¶
func Escapef ¶ added in v0.0.2
Escapef is a formatted version of Escape, but it does not escape a. This means that these values must be valid when parsed via ParseMode.
func FormatCommandHelp ¶ added in v0.0.2
func FormatCommandHelp(cmd commandtypes.Desc) string
func FormatCommandShortHelp ¶ added in v0.0.2
func FormatCommandShortHelp(cmd commandtypes.Desc) string
func FormatCommandUsage ¶ added in v0.0.2
func FormatCommandUsage(cmd commandtypes.Desc) string
func FormatHelp ¶ added in v0.0.2
func FormatHelp(cmds []commandtypes.Desc) string
func FormatMessageCreated ¶ added in v0.0.2
func FormatMessages ¶
FormatMessages formats a list of messages for the report. If present, header must be valid when parsed with ParseMode (see Escape).
func FormatStart ¶
func FormatStart() string
func MustRenderTemplate ¶ added in v0.0.2
MustRenderTemplate acts like RenderTemplate, but panics on errors.
func RenderTemplate ¶ added in v0.0.2
RenderTemplate renders text/template.Template tmpl. All plaint text nodes of the template are escaped via Escape. The following functions are also availible in template context:
- "bold" -> Bold
- "mono" -> Mono
- "esc" -> Escape
Types ¶
type SyntaxError ¶ added in v0.0.2
type SyntaxError struct { Msg string Cmd *commandtypes.Desc }
func NewCommandSyntaxErrorf ¶ added in v0.0.2
func NewCommandSyntaxErrorf(cmd commandtypes.Desc, format string, a ...any) SyntaxError
func NewSyntaxErrorf ¶ added in v0.0.2
func NewSyntaxErrorf(format string, a ...any) SyntaxError
func (SyntaxError) Error ¶ added in v0.0.2
func (e SyntaxError) Error() string
func (SyntaxError) Printable ¶ added in v0.0.2
func (e SyntaxError) Printable() string
Click to show internal directories.
Click to hide internal directories.