Documentation ¶
Index ¶
Constants ¶
const ( ThreadTypeCooldown uint = iota ThreadTypeDate )
const ( FlagAutoIncrement = "AUTO_INCREMENT" FlagPrimaryKey = "PRIMARY KEY" FlagUnsigned = "UNSIGNED" FlagNotNull = "NOT NULL" FlagUnique = "UNIQUE" )
All possiable tags for columns
Variables ¶
var ( ErrInvalidCommandUsage = errors.New("Invalid command usage") ErrNoPermission = errors.New("No Permission") )
Error constants
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { Name string Description string Usage string Example string Permissions []string // A list of permissions required to run this PermissionLevel uint // DEPRECIATED ResponseTTL time.Duration // ResponseTTL defines the time the command response can be cached and reused Execute func(*discordgo.Session, *discordgo.MessageCreate, []string) error }
type Module ¶
type Module struct { Name string Description string GuildOnly bool Commands map[string]Command Tasks []*Task Permissions []string SQLTables []*SQLTable // A number of tables that can be used to hold persistent data Depends []*Module // Modules the module depends on }
A Module represents a set of commands and functionalities that have similar usage or work together modules are called using <server prefix> <module name> Name: the name of the module, used for help messages and to call commands of this module Description: basic description of the funtionanlity of this module Args: whether the module takes args --> no more effect GuildOnly: whether the module may only be called from discord servers (officially guilds) Commands: a list of command routes that will be claimed for this module --> no more effect SubCommands: a list of commands of this module, the map identifier is the command's name Threads: a list of background threads to be executed for each guild in specific time intervals Execute: not used anymore, see SubCommad.Execute and use command specific execute calls
type ModuleResponse ¶
type ModuleResponse struct { Code uint // 0 = noerror / 1 = invalidCommandUsage / 2 = permissionDenied / 3 = InternalServerError Error error }
ModuleResponse contains the data returned by the called commands goroutine