utils

package
v0.0.0-...-abf6750 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LinkRegex = regexp.MustCompile(`https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)`)

Functions

func Fmt

func Fmt(s string, a ...interface{}) string

func FormatTime

func FormatTime(duration time.Duration) string

func FromWeb

func FromWeb(url string) ([]byte, error)

func FromWebString

func FromWebString(url string) (string, error)

func IntegerArrayContains

func IntegerArrayContains(array []int, number int) bool

func Is

func Is(value bool, a, n string) string

func ParseDuration

func ParseDuration(duration string) (time.Duration, error)

func RandomBool

func RandomBool() bool

func StringArrayContains

func StringArrayContains(array []string, term string) bool

Types

type Embed

type Embed struct {
	discord.Embed
}

func NewEmbed

func NewEmbed() *Embed

func (*Embed) Author

func (e *Embed) Author(args ...string) *Embed

func (*Embed) Build

func (e *Embed) Build() discord.Embed

func (*Embed) Color

func (e *Embed) Color(color int) *Embed

func (*Embed) Description

func (e *Embed) Description(desc string, args ...interface{}) *Embed

func (*Embed) Field

func (e *Embed) Field(name, value interface{}, inline bool) *Embed

func (*Embed) Footer

func (e *Embed) Footer(content, imgUrl string) *Embed

func (*Embed) Image

func (e *Embed) Image(url string) *Embed

func (*Embed) SetField

func (e *Embed) SetField(index int, name, value string, inline bool) *Embed

func (*Embed) Thumbnail

func (e *Embed) Thumbnail(url string) *Embed

func (*Embed) Timestamp

func (e *Embed) Timestamp(time time.Time) *Embed

func (*Embed) Title

func (e *Embed) Title(title string, args ...interface{}) *Embed

func (*Embed) URL

func (e *Embed) URL(url string) *Embed

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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