Documentation ¶
Index ¶
- func BuildHelp(feature Feature) (embed *dg.MessageEmbed)
- func FilterTag(tag string) string
- func HasRole(has []string, required []string) bool
- func Mention(s *dg.Session, userID string, channelID string, context string) (*dg.Message, error)
- func Reply(s *dg.Session, msg *dg.Message, context string) (*dg.Message, error)
- func VerifyEmbed(e *dg.MessageEmbed) error
- type Command
- type ControlEmojis
- type Embed
- func (e *Embed) AddField(Name string, Value string, Inline bool)
- func (e *Embed) ChannelMessageEditEmbed(s *dg.Session, channelID string, messageID string) (*dg.Message, error)
- func (e *Embed) InlineAllFields() *Embed
- func (e *Embed) SendToChannel(s *dg.Session, channelID string) (*dg.Message, error)
- func (e *Embed) SendToWebhook(Webhook string) error
- func (e *Embed) SetAuthor(Name string, IconURL string, URL string)
- func (e *Embed) SetColor(ColorByte int)
- func (e *Embed) SetDescription(Description string)
- func (e *Embed) SetFooter(IconURL string, Text string)
- func (e *Embed) SetImage(URL string)
- func (e *Embed) SetThumbnail(URL string)
- func (e *Embed) SetTitle(Title string)
- func (e *Embed) SetURL(URL string)
- func (e *Embed) Truncate() *Embed
- type Feature
- type Paginator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildHelp ¶
func BuildHelp(feature Feature) (embed *dg.MessageEmbed)
BuildHelp makes a help message embed.
func FilterTag ¶
FilterTag takes intakes a ID formatted by the Discord client ie <#ID>, <:ID>, or <#ID> and returns ID.
func Reply ¶
Reply sends a response in the same channel to the same user who sent the message. The sent message and possible error is returned.
func VerifyEmbed ¶
func VerifyEmbed(e *dg.MessageEmbed) error
Types ¶
type Command ¶
type Command struct { // Name is the command name that is callable by a Discord user // ie. "request" Name string // Description describes your command's usage // ie. "This is for request a new nickname" Description string // Example is example usage of the command // ie. [".nick", "request", "new nickname"] Example []string }
Command are all the possible commands that exist.
type ControlEmojis ¶
type ControlEmojis struct {
// contains filtered or unexported fields
}
ControlEmojis contains the structure and default structure for pagination emojis
type Embed ¶
type Embed struct {
*dg.MessageEmbed
}
Embed structure
func (*Embed) AddField ¶
AddField takes <Name string> <Value string> <Inline bool> Returns an embed with embed field set <Name> <Value> <Inline>
func (*Embed) ChannelMessageEditEmbed ¶
func (e *Embed) ChannelMessageEditEmbed(s *dg.Session, channelID string, messageID string) (*dg.Message, error)
ChannelMessageEditEmbed takes <s *dg.Session>, <channelID string>, <messageID string> Verifies embed and edits message with new embed Returns message and error
func (*Embed) InlineAllFields ¶
InlineAllFields sets all fields in the embed to be inline
func (*Embed) SendToChannel ¶
SendToChannel takes <s *dg.Session>, <channelID string> Verifies embed and sends embed to channel Returns message and error
func (*Embed) SendToWebhook ¶
SendToWebhook takes <Webhook string> Sends embed to webhook Returns error if invalid embed or error posting to webhook
func (*Embed) SetAuthor ¶
SetAuthor takes <Name string> <IconURL string> <URL string> Returns embed with author set <Name> <IconURL> <URL>
func (*Embed) SetDescription ¶
SetDescription takes <Description string> Sets embed with description set <Description>
func (*Embed) SetFooter ¶
SetFooter takes <IconURL string> <Text string> Sets embed with embed footer set <Iconurl> <Text>
func (*Embed) SetThumbnail ¶
SetThumbnail takes <URL string> Sets embed thumbnail to <URL>
type Feature ¶
type Feature struct { // Name of your feature ie. "Nickname Manager" Name string // Description for describing your feature "Moderates nicknames" Description string // Commands are all the possible commands that exist, optionally empty. Commands []*Command // Prefix is the prefix for your bot. Prefix string }
Feature represents your bot.
type Paginator ¶
type Paginator struct {
// contains filtered or unexported fields
}
Paginator contains the structure for the paginator.
func NewPaginator ¶
func NewPaginator(s *dg.Session, channelID string, user *dg.User, controlEmojis ControlEmojis, timeOut time.Duration, infoMessages bool) *Paginator
NewPaginator takes <s *dg.Session>, <channelID string>, <user *dg.User> Returns standard *Paginator