Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // CommandsValidator is the validation schema for bot commands collection. CommandsValidator = bson.D{ {Key: "$jsonSchema", Value: bson.D{ {Key: "bsonType", Value: bson.A{"object", "array"}}, {Key: "required", Value: bson.A{"guildId", "kind", "name"}}, {Key: "properties", Value: bson.D{ {Key: "guildId", Value: bson.D{ {Key: "bsonType", Value: "long"}, {Key: "description", Value: "must be a positive non-zero number"}, {Key: "minimum", Value: 1}, }}, {Key: "kind", Value: bson.D{ {Key: "bsonType", Value: "int"}, {Key: "description", Value: "must be a valid command kind identifier"}, {Key: "minimum", Value: 1}, {Key: "maximum", Value: 1}, }}, {Key: "name", Value: bson.D{ {Key: "bsonType", Value: "string"}, {Key: "description", Value: "must be a string and is required"}, }}, }}, }}, } )
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct { Code int `json:"code"` Description string `json:"description"` Message string `json:"message,omitempty"` }
APIError is a struct that contains information about a failed API call.
type Command ¶
type Command struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` GuildID uint64 `bson:"guildId,omitempty" json:"guild_id,omitempty"` Kind CommandKind `bson:"kind,omitempty" json:"kind,omitempty"` Name string `bson:"name,omitempty" json:"name,omitempty"` }
Command is the model for customizable bot commands.
type CommandKind ¶
type CommandKind int
Custom type for command kinds.
const (
TextCommand CommandKind = 1 << iota
)
Command kinds.
Click to show internal directories.
Click to hide internal directories.