Documentation ¶
Index ¶
- Constants
- Variables
- func CategoryFromName(s *discordgo.Session, name, gID string) (string, error)
- func ChannelArgument(s *discordgo.Session, name, gID string) (string, discordgo.ChannelType, error)
- func ChannelFromString(s string) (string, bool)
- func ConcatStrings(args ...string) string
- func ExtractChannelID(mention string) string
- func ExtractRoleID(mention string) string
- func ExtractUserID(mention string) string
- func MentionChannel(id string) string
- func MentionFromString(s string) (string, bool)
- func MentionRole(id string) string
- func MentionUser(id string) string
- func NewEmbed() *discordgo.MessageEmbed
- func ResponseData(userid, msg string) *discordgo.MessageSend
- func RoleFromString(s string) (string, bool)
- type BigEmbed
- type Cache
Constants ¶
const ( ColorBlack = 0x000000 ColorSilver = 0xc0c0c0 ColorGray = 0x808080 ColorWhite = 0xffffff ColorMaroon = 0x800000 ColorRed = 0xff0000 ColorPurple = 0x800080 ColorFuchsia = 0xff00ff ColorGreen = 0x008000 ColorLime = 0x00ff00 ColorOlive = 0x808000 ColorYellow = 0xffff00 ColorBlue = 0x0000ff ColorTeal = 0x008080 ColorAqua = 0x00ffff )
----------------------------------- --- CSS LEVEL 1 --- --- https://www.w3.org/TR/CSS1/ --- -----------------------------------
const (
ColorOrange = 0xffa500
)
----------------------------------- --- CSS Level 2 (Revision 1) --- --- https://www.w3.org/TR/CSS2/ --- -----------------------------------
Variables ¶
var (
ErrNotFound = errors.New("not found")
)
Error constants
Functions ¶
func CategoryFromName ¶
CategoryFromName gets a category from it's name
func ChannelArgument ¶
ChannelArgument extracts the channel from a string argument It returns the channel id, the channel type. The error is ErrNotFound when the channel wasn't found s is the discord Session, name the requested channel and gID the guild id where to search When multiple channels with the same name are present, the first one found will be returned
func ChannelFromString ¶
ChannelFromString extracts a discord channelid from a string when no channel was found it returns false
func ConcatStrings ¶
ConcatStrings concates multiple strings
func ExtractChannelID ¶
ExtractChannelID extracts a discord channel id from a mention
func ExtractRoleID ¶
ExtractRoleID extracts a discord role id from a mention
func ExtractUserID ¶
ExtractUserID extracts a discord user id from a mention
func MentionChannel ¶
MentionChannel returns a mentino to a channel
func MentionFromString ¶
MentionFromString extracts a discord userid from a string when no user was found it returns false
func NewEmbed ¶
func NewEmbed() *discordgo.MessageEmbed
NewEmbed returns a new Embed with the default color (red)
func ResponseData ¶
func ResponseData(userid, msg string) *discordgo.MessageSend
ResponseData returns the data to send a @User, [msg] message
func RoleFromString ¶
RoleFromString extracs a discord role mention from a strings when no mention was found it returns false
Types ¶
type BigEmbed ¶
type BigEmbed struct {
// contains filtered or unexported fields
}
BigEmbed contains multiple embeds with descriptions longer than the maximum length of 2048
func NewBigEmbed ¶
NewBigEmbed creates a new big embed name is the embed title color is the embed color ln is the length of the slice of items that should be displayed getFn should return the string to append at a specific index maxLen is the maximun possible length of an entry. It is used to define when to create a new embed