Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
func NewCommand ¶
func NewCommand(opts ...CommandOption) *Command
func (*Command) HasPermission ¶
type CommandMap ¶
type CommandMap struct {
// contains filtered or unexported fields
}
func NewCommandMap ¶
func NewCommandMap(opts ...CommandMapOption) *CommandMap
func (*CommandMap) BuildUsage ¶
func (cm *CommandMap) BuildUsage(command string) string
func (*CommandMap) ExecuteCommand ¶
type CommandMapOption ¶
type CommandMapOption func(*CommandMap)
func WithMapCommand ¶
func WithMapCommand(name string, c *Command) CommandMapOption
func WithMapScope ¶
func WithMapScope(scope bool) CommandMapOption
type CommandOption ¶
type CommandOption func(*Command)
func WithCommandArgs ¶
func WithCommandArgs(a int) CommandOption
func WithCommandFn ¶
func WithCommandFn(fn func(context.Context, *Session) error) CommandOption
func WithCommandPermissions ¶
func WithCommandPermissions(p int) CommandOption
func WithCommandUsage ¶
func WithCommandUsage(us string) CommandOption
type Session ¶
type Session struct {
Msg *discord.Message
// Entire message
Argv []string
// Without command trigger
Args []string
// Prefix that triggered the command
Prefix string
// DB row for the origin guild
Guild *modelsx.GuildWithPrefixes
Bot bot.Client
Tx *sql.Tx
}
func NewMessageSession ¶
func NewMessageSession(opts ...SessionOption) *Session
type SessionOption ¶
type SessionOption func(s *Session)
func WithSessionClient ¶
func WithSessionClient(b bot.Client) SessionOption
func WithSessionGuild ¶
func WithSessionGuild(g *modelsx.GuildWithPrefixes) SessionOption
func WithSessionMessage ¶
func WithSessionMessage(m *discord.Message) SessionOption
func WithSessionTx ¶
func WithSessionTx(tx *sql.Tx) SessionOption
Click to show internal directories.
Click to hide internal directories.