emutil

package module
v0.0.0-...-e2c0f5e Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: GPL-3.0 Imports: 6 Imported by: 1

README

discordgo-emoji-util

A few functions used for doing stuff with emojis in discordgo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeEmojiByID

func EncodeEmojiByID(emojiID string) string

EncodeEmojiByID - takes an emoji ID and returns the base64 encoded emoji image, used to add emojis. Returns empty string if something fails emojiID: the id of the emoji in question

func EncodeImageEmoji

func EncodeImageEmoji(link string) string

EncodeImageEmoji - encodes an image link to base64, discord takes base64 to add an emoji so this will return what needs to be given to discord. link: the url that the emoji resides at

func FindEmoji

func FindEmoji(emojis []*discordgo.Emoji, emojiName string, caseSensitive bool) *discordgo.Emoji

FindEmoji - Find a specific emoji in an array of emojis emojis: list of discordgo.Emoji emojiName: string that represents the emoji name you're trying to find the list castSensitive: if the emoji finding should be case sensitive or not

Types

type Emoji

type Emoji struct {
	ID       string
	Name     string
	Animated bool
}

Emoji - contains the emojis id and name and if the emoji is animated or not.

func MatchEmojis

func MatchEmojis(messageContent string) []*Emoji

MatchEmojis - uses an emoji regex to match all emojis in a message, returns list of Emoji struct. Returns nil if something goes wrong or nothing is found! messageContent: the string that we apply the regex to.

Jump to

Keyboard shortcuts

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