utility

package
v0.0.0-...-04ee80e Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2019 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseSafely

func CloseSafely(toClose io.Closer)

CloseSafely closes an entity and logs in case of errors

func DownloadFile

func DownloadFile(filepath string, url string) (err error)

DownloadFile downloads a file using a GET http request

func FindURLs

func FindURLs(text string) (links []string)

FindURLs finds URL in a text.

func GetHandleOrUserName

func GetHandleOrUserName(user *tgbotapi.User) (name string)

GetHandleOrUserName returns the user handle or their first and last name

func GetVideo

func GetVideo(url string) (path string, err error)

GetVideo downloads the video

func GetVideoID

func GetVideoID(url string) (ID string)

GetVideoID returns the ID of the video to download

func RandomNumber

func RandomNumber(len int64) int64

RandomNumber returns a number between 0 and len

Types

This section is empty.

Jump to

Keyboard shortcuts

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