utils

package
v0.0.0-...-4014866 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrColorInvalid = errors.New("hex code is invalid")
)

This holds the errors that HexColorToInt will throw.

Functions

func ExtractUserIDFromMention

func ExtractUserIDFromMention(mention string) string

ExtractUserIDFromMention takes in a mention (<@ID>) and spits out only the ID.

func GetStringFromQuotes

func GetStringFromQuotes(parts []string) []string

GetStringFromQuotes finds a "string which spans multiple spaces" in a split message. It then takes that and replaces the Quote string with a single string value of the quote contents.

func HexColorToInt

func HexColorToInt(hexCode string) (int, error)

HexColorToInt converts a hex color code to an int, which is usable in the Discord API. The hexCode is without the "#" prefix.

Types

This section is empty.

Jump to

Keyboard shortcuts

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