Documentation ¶
Index ¶
- Constants
- Variables
- func AnyEntities(message *telebot.Message) telebot.Entities
- func EmbedGUID(guid string) string
- func EmbedImage(url string) string
- func Escape(s string) string
- func FormatFloat(f float64) string
- func FormatThousand[T constraints.Integer](n T) string
- func FullName(firstName, lastName string) string
- func GermanTimezone() *time.Location
- func HumanizeDuration(d *duration.Duration) string
- func IsAdmin(user *telebot.User) bool
- func LocalizeDatestring(date string) string
- func RoundAndFormatThousand(n float64) string
- type VersionInfo
Constants ¶
View Source
const ( OnMsg = "\agobot_msg" // Shortcut for handling any message Day = 24 * time.Hour Week = 7 * Day InlineQueryFailureCacheTime = 2 // In seconds MaxMessageLength = 4096 MaxFilesizeDownload = 20000000 // Max filesize that can be downloaded from Telegram = 20MB MaxFilesizeUpload = 50000000 // Max filesize that can be uploaded to Telegram = 50MB MaxPhotosizeUpload = 10000000 // Max filesize of photos that can be uploaded to Telegram = 10 MB MaxPhotosizeThroughTelegram = 5000000 // Max filesize of photos that Telegram can send automatically = 5 MB UserAgent = "Mozilla/5.0 (Windows NT 11.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" )
Variables ¶
View Source
var ( DefaultSendOptions = &telebot.SendOptions{ AllowWithoutReply: true, DisableWebPagePreview: true, DisableNotification: true, ParseMode: telebot.ModeHTML, } )
Functions ¶
func AnyEntities ¶
func AnyEntities(message *telebot.Message) telebot.Entities
func EmbedImage ¶
func FormatFloat ¶
func FormatThousand ¶
func FormatThousand[T constraints.Integer](n T) string
func GermanTimezone ¶
func HumanizeDuration ¶
func LocalizeDatestring ¶
func RoundAndFormatThousand ¶
Types ¶
type VersionInfo ¶
type VersionInfo struct { GoVersion string GoOS string GoArch string Revision string LastCommit time.Time DirtyBuild bool }
func ReadVersionInfo ¶
func ReadVersionInfo() (VersionInfo, error)
Click to show internal directories.
Click to hide internal directories.