disgone

package module
v0.0.0-...-40fdae2 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2020 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSession

func NewSession(bot interface{}, options *BotOptions, token string) (*discordgo.Session, error)

Types

type Argument

type Argument struct {
	Name     string `json:"name"`
	Type     string `json:"type"`
	Optional bool   `json:"optional"`
	Infinite bool   `json:"infinite"`
}

type BotOptions

type BotOptions struct {
	Commands   CommandMap
	Types      map[string]string
	Prefix     string
	GroupNames map[Group]string
	Errors     chan struct {
		Err error
		*discordgo.MessageCreate
	}
	OnPanic func(*discordgo.Session, *discordgo.MessageCreate, interface{})
}

type Command

type Command struct {
	Description string      `json:"description"`
	Arguments   []*Argument `json:"arguments"`
	Cooldown    int         `json:"cooldown"`
	Group       `json:"permission"`
	Aliases     []string `json:"aliases"`
	Examples    []string `json:"examples"`
	Hidden      bool     `json:"hidden"`
}

func (Command) ForcedArgs

func (c Command) ForcedArgs() (i int)

func (Command) GetUsage

func (c Command) GetUsage(prefix, name string) string

type CommandMap

type CommandMap map[string]*Command

type Group

type Group uint

type Handler

type Handler func(session *discordgo.Session,
	message *discordgo.MessageCreate,
	args map[string]string) error

type HandlerMap

type HandlerMap map[string]Handler

type InsufficientPermissionsError

type InsufficientPermissionsError struct {
	Required string
	Had      string
}

func (InsufficientPermissionsError) Error

type UsageError

type UsageError struct {
	Usage string
}

func (UsageError) Error

func (e UsageError) Error() string

type UserGroup

type UserGroup func(session *discordgo.Session,
	guild *discordgo.Guild,
	member *discordgo.Member) Group

type ZeroArgumentsError

type ZeroArgumentsError struct {
	Command string
}

func (ZeroArgumentsError) Error

func (e ZeroArgumentsError) Error() string

Jump to

Keyboard shortcuts

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