Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ImgUrlSRx = regexp.MustCompile(`^https?:\/\/([\w-]+\.)+([\w-]+)(\/[\w-]+)*.*\.(png|jpg|jpeg|gif|ico|tiff|img|bmp|mp4)$`)
)
Functions ¶
func ExtractFromMessage ¶
func ExtractFromMessage(text string, attachments []*discordgo.MessageAttachment) (resText, imgLink string)
ExtractFromMessage tries to extract an image URL from the passed text or message attachments and returns the text of the message excluding the matched link and the image link.
Types ¶
type Image ¶
Image wraps metadata and data of an image.
func DownloadFromURL ¶
DownloadFromURL tries to GET an image from the passed resource URL, downloading it and returning the metadata and data of the image as well as occured errors.
func (*Image) GenerateID ¶
func (img *Image) GenerateID()
Click to show internal directories.
Click to hide internal directories.