commands

package
v0.0.0-...-ba096a2 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2018 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Specific command functionality for moebot. Each command should be in its own file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NextChannelUID

func NextChannelUID(c *types.ChannelRotation) string

func ParseCommand

func ParseCommand(commParams []string, arguments []string) map[string]string

Parses a given param list, mapping them to the given arguments if possible.

Types

type ChangelogCommand

type ChangelogCommand struct {
	Version string
}

func (*ChangelogCommand) Execute

func (cc *ChangelogCommand) Execute(pack *CommPackage)

func (*ChangelogCommand) GetCommandHelp

func (cc *ChangelogCommand) GetCommandHelp(commPrefix string) string

func (*ChangelogCommand) GetCommandKeys

func (cc *ChangelogCommand) GetCommandKeys() []string

func (*ChangelogCommand) GetPermLevel

func (cc *ChangelogCommand) GetPermLevel() types.Permission

type ChannelRotationScheduler

type ChannelRotationScheduler struct {
	// contains filtered or unexported fields
}

func NewChannelRotationScheduler

func NewChannelRotationScheduler(schedulerType types.SchedulerType, session *discordgo.Session) *ChannelRotationScheduler

func (*ChannelRotationScheduler) AddScheduledOperation

func (s *ChannelRotationScheduler) AddScheduledOperation(comm *CommPackage) error

func (*ChannelRotationScheduler) Execute

func (s *ChannelRotationScheduler) Execute(operationId int64)

func (*ChannelRotationScheduler) Help

func (s *ChannelRotationScheduler) Help() string

func (*ChannelRotationScheduler) Keyword

func (s *ChannelRotationScheduler) Keyword() string

func (*ChannelRotationScheduler) OperationDescription

func (s *ChannelRotationScheduler) OperationDescription(operationID int64) string

type CommPackage

type CommPackage struct {
	// contains filtered or unexported fields
}

func NewCommPackage

func NewCommPackage(session *discordgo.Session, message *discordgo.Message, guild *discordgo.Guild, member *discordgo.Member, channel *discordgo.Channel,
	params []string, user *types.UserProfile, timer *event.Timer) CommPackage

type Command

type Command interface {
	Execute(pack *CommPackage)
	GetPermLevel() types.Permission
	GetCommandKeys() []string
	GetCommandHelp(commPrefix string) string
}

type EchoCommand

type EchoCommand struct {
}

func (*EchoCommand) Execute

func (ec *EchoCommand) Execute(pack *CommPackage)

func (*EchoCommand) GetCommandHelp

func (ec *EchoCommand) GetCommandHelp(commPrefix string) string

func (*EchoCommand) GetCommandKeys

func (ec *EchoCommand) GetCommandKeys() []string

func (*EchoCommand) GetPermLevel

func (ec *EchoCommand) GetPermLevel() types.Permission

type EventHandler

type EventHandler interface {
	EventHandlers() []interface{}
}

type FetchCommand

type FetchCommand struct {
	MasterId string
}

Fetches information about something within discord. Useful for debugging why something isn't working correctly.

func (*FetchCommand) Execute

func (fc *FetchCommand) Execute(pack *CommPackage)

func (*FetchCommand) GetCommandHelp

func (fc *FetchCommand) GetCommandHelp(commPrefix string) string

func (*FetchCommand) GetCommandKeys

func (fc *FetchCommand) GetCommandKeys() []string

func (*FetchCommand) GetPermLevel

func (fc *FetchCommand) GetPermLevel() types.Permission

type GroupSetCommand

type GroupSetCommand struct {
	ComPrefix string
}

func (*GroupSetCommand) Execute

func (gc *GroupSetCommand) Execute(pack *CommPackage)

func (*GroupSetCommand) GetCommandHelp

func (gc *GroupSetCommand) GetCommandHelp(commPrefix string) string

func (*GroupSetCommand) GetCommandKeys

func (gc *GroupSetCommand) GetCommandKeys() []string

func (*GroupSetCommand) GetPermLevel

func (gc *GroupSetCommand) GetPermLevel() types.Permission

type HelpCommand

type HelpCommand struct {
	ComPrefix string
	Commands  func() []Command
	Checker   permissions.PermissionChecker
}

func (*HelpCommand) Execute

func (hc *HelpCommand) Execute(pack *CommPackage)

func (*HelpCommand) GetCommandHelp

func (hc *HelpCommand) GetCommandHelp(commPrefix string) string

func (*HelpCommand) GetCommandKeys

func (hc *HelpCommand) GetCommandKeys() []string

func (*HelpCommand) GetPermLevel

func (hc *HelpCommand) GetPermLevel() types.Permission

type MentionCommand

type MentionCommand struct {
}

func (*MentionCommand) Execute

func (mc *MentionCommand) Execute(pack *CommPackage)

func (*MentionCommand) GetCommandHelp

func (mc *MentionCommand) GetCommandHelp(commPrefix string) string

func (*MentionCommand) GetCommandKeys

func (mc *MentionCommand) GetCommandKeys() []string

func (*MentionCommand) GetPermLevel

func (mc *MentionCommand) GetPermLevel() types.Permission

type PermitCommand

type PermitCommand struct {
}

func (*PermitCommand) Execute

func (pc *PermitCommand) Execute(pack *CommPackage)

func (*PermitCommand) GetCommandHelp

func (pc *PermitCommand) GetCommandHelp(commPrefix string) string

func (*PermitCommand) GetCommandKeys

func (pc *PermitCommand) GetCommandKeys() []string

func (*PermitCommand) GetPermLevel

func (pc *PermitCommand) GetPermLevel() types.Permission

type PinMoveCommand

type PinMoveCommand struct {
	// contains filtered or unexported fields
}

func (*PinMoveCommand) EventHandlers

func (pc *PinMoveCommand) EventHandlers() []interface{}

func (*PinMoveCommand) Execute

func (pc *PinMoveCommand) Execute(pack *CommPackage)

func (*PinMoveCommand) GetCommandHelp

func (pc *PinMoveCommand) GetCommandHelp(commPrefix string) string

func (*PinMoveCommand) GetCommandKeys

func (pc *PinMoveCommand) GetCommandKeys() []string

func (*PinMoveCommand) GetPermLevel

func (pc *PinMoveCommand) GetPermLevel() types.Permission

func (*PinMoveCommand) Setup

func (pc *PinMoveCommand) Setup(session *discordgo.Session)

type PingCommand

type PingCommand struct {
}

func (*PingCommand) Execute

func (pc *PingCommand) Execute(pack *CommPackage)

func (*PingCommand) GetCommandHelp

func (pc *PingCommand) GetCommandHelp(commPrefix string) string

func (*PingCommand) GetCommandKeys

func (pc *PingCommand) GetCommandKeys() []string

func (*PingCommand) GetPermLevel

func (pc *PingCommand) GetPermLevel() types.Permission

type PollCommand

type PollCommand struct {
	PollsHandler *PollsHandler
}

func (*PollCommand) EventHandlers

func (pc *PollCommand) EventHandlers() []interface{}

func (*PollCommand) Execute

func (pc *PollCommand) Execute(pack *CommPackage)

func (*PollCommand) GetCommandHelp

func (pc *PollCommand) GetCommandHelp(commPrefix string) string

func (*PollCommand) GetCommandKeys

func (pc *PollCommand) GetCommandKeys() []string

func (*PollCommand) GetPermLevel

func (pc *PollCommand) GetPermLevel() types.Permission

type PollsHandler

type PollsHandler struct {
	// contains filtered or unexported fields
}

func NewPollsHandler

func NewPollsHandler() *PollsHandler

type ProfileCommand

type ProfileCommand struct {
	MasterId string
}

func (*ProfileCommand) Execute

func (pc *ProfileCommand) Execute(pack *CommPackage)

func (*ProfileCommand) GetCommandHelp

func (pc *ProfileCommand) GetCommandHelp(commPrefix string) string

func (*ProfileCommand) GetCommandKeys

func (pc *ProfileCommand) GetCommandKeys() []string

func (*ProfileCommand) GetPermLevel

func (pc *ProfileCommand) GetPermLevel() types.Permission

type RaffleCommand

type RaffleCommand struct {
	MasterId     string
	DebugChannel string
}

func (*RaffleCommand) EventHandlers

func (rc *RaffleCommand) EventHandlers() []interface{}

func (*RaffleCommand) Execute

func (rc *RaffleCommand) Execute(pack *CommPackage)

func (*RaffleCommand) GetCommandHelp

func (rc *RaffleCommand) GetCommandHelp(commPrefix string) string

func (*RaffleCommand) GetCommandKeys

func (rc *RaffleCommand) GetCommandKeys() []string

func (*RaffleCommand) GetPermLevel

func (rc *RaffleCommand) GetPermLevel() types.Permission

type RoleCommand

type RoleCommand struct {
	ComPrefix   string
	PermChecker permissions.PermissionChecker
}

func (*RoleCommand) Execute

func (rc *RoleCommand) Execute(pack *CommPackage)

func (*RoleCommand) GetCommandHelp

func (rc *RoleCommand) GetCommandHelp(commPrefix string) string

func (*RoleCommand) GetCommandKeys

func (rc *RoleCommand) GetCommandKeys() []string

func (*RoleCommand) GetPermLevel

func (rc *RoleCommand) GetPermLevel() types.Permission

type RoleHandler

type RoleHandler struct {
	ComPrefix string
}

type RoleSetCommand

type RoleSetCommand struct {
	ComPrefix string
}

func (*RoleSetCommand) Execute

func (rc *RoleSetCommand) Execute(pack *CommPackage)

func (*RoleSetCommand) GetCommandHelp

func (rc *RoleSetCommand) GetCommandHelp(commPrefix string) string

func (*RoleSetCommand) GetCommandKeys

func (rc *RoleSetCommand) GetCommandKeys() []string

func (*RoleSetCommand) GetPermLevel

func (rc *RoleSetCommand) GetPermLevel() types.Permission

type ScheduleCommand

type ScheduleCommand struct {
	// contains filtered or unexported fields
}

func NewScheduleCommand

func NewScheduleCommand(factory *SchedulerFactory) *ScheduleCommand

func (*ScheduleCommand) Execute

func (c *ScheduleCommand) Execute(pack *CommPackage)

func (*ScheduleCommand) GetCommandHelp

func (c *ScheduleCommand) GetCommandHelp(commPrefix string) string

func (*ScheduleCommand) GetCommandKeys

func (c *ScheduleCommand) GetCommandKeys() []string

func (*ScheduleCommand) GetPermLevel

func (c *ScheduleCommand) GetPermLevel() types.Permission

type Scheduler

type Scheduler interface {
	Execute(operationID int64)
	Keyword() string
	AddScheduledOperation(comm *CommPackage) error
	Help() string
	OperationDescription(operationID int64) string
}

type SchedulerFactory

type SchedulerFactory struct {
	// contains filtered or unexported fields
}

func NewSchedulerFactory

func NewSchedulerFactory(session *discordgo.Session) *SchedulerFactory

func (*SchedulerFactory) CreateScheduler

func (f *SchedulerFactory) CreateScheduler(t types.SchedulerType) Scheduler

type ServerCommand

type ServerCommand struct {
	ComPrefix string
}

func (*ServerCommand) Execute

func (sc *ServerCommand) Execute(pack *CommPackage)

func (*ServerCommand) GetCommandHelp

func (sc *ServerCommand) GetCommandHelp(commPrefix string) string

func (*ServerCommand) GetCommandKeys

func (sc *ServerCommand) GetCommandKeys() []string

func (*ServerCommand) GetPermLevel

func (sc *ServerCommand) GetPermLevel() types.Permission

type SetupHandler

type SetupHandler interface {
	Setup(session *discordgo.Session)
}

type SpoilerCommand

type SpoilerCommand struct{}

func (*SpoilerCommand) Execute

func (sc *SpoilerCommand) Execute(pack *CommPackage)

func (*SpoilerCommand) GetCommandHelp

func (sc *SpoilerCommand) GetCommandHelp(commPrefix string) string

func (*SpoilerCommand) GetCommandKeys

func (sc *SpoilerCommand) GetCommandKeys() []string

func (*SpoilerCommand) GetPermLevel

func (sc *SpoilerCommand) GetPermLevel() types.Permission

type SubCommand

type SubCommand struct {
	RedditHandle *reddit.Handle
}

func (*SubCommand) Execute

func (sc *SubCommand) Execute(pack *CommPackage)

func (*SubCommand) GetCommandHelp

func (sc *SubCommand) GetCommandHelp(commPrefix string) string

func (*SubCommand) GetCommandKeys

func (sc *SubCommand) GetCommandKeys() []string

func (*SubCommand) GetPermLevel

func (sc *SubCommand) GetPermLevel() types.Permission

type SubmitCommand

type SubmitCommand struct {
	ComPrefix string
}

func (*SubmitCommand) Execute

func (sc *SubmitCommand) Execute(pack *CommPackage)

func (*SubmitCommand) GetCommandHelp

func (sc *SubmitCommand) GetCommandHelp(commPrefix string) string

func (*SubmitCommand) GetCommandKeys

func (sc *SubmitCommand) GetCommandKeys() []string

func (*SubmitCommand) GetPermLevel

func (sc *SubmitCommand) GetPermLevel() types.Permission

type TimerCommand

type TimerCommand struct {
	Checker permissions.PermissionChecker
	// contains filtered or unexported fields
}

func NewTimerCommand

func NewTimerCommand() *TimerCommand

func (*TimerCommand) Execute

func (tc *TimerCommand) Execute(pack *CommPackage)

func (*TimerCommand) GetCommandHelp

func (tc *TimerCommand) GetCommandHelp(commPrefix string) string

func (*TimerCommand) GetCommandKeys

func (tc *TimerCommand) GetCommandKeys() []string

func (*TimerCommand) GetPermLevel

func (tc *TimerCommand) GetPermLevel() types.Permission

type VeteranHandler

type VeteranHandler struct {
	// contains filtered or unexported fields
}

func NewVeteranHandler

func NewVeteranHandler(comPrefix string, debugChannel string, masterId string) *VeteranHandler

func (*VeteranHandler) EventHandlers

func (vh *VeteranHandler) EventHandlers() []interface{}

Jump to

Keyboard shortcuts

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