Documentation
¶
Index ¶
- type Command
- type CommandTrigger
- type GlobalCommand
- func NewChangeUsername() *GlobalCommand
- func NewChatEmpty() *GlobalCommand
- func NewGameDoesntStart() *GlobalCommand
- func NewGameNotAvailable() *GlobalCommand
- func NewGlobalCommand(keywords [][]string, response string) *GlobalCommand
- func NewInstallLinux() *GlobalCommand
- func NewQuestCrashes() *GlobalCommand
- func NewUpdateLauncher() *GlobalCommand
- type Romans
- type SentenceDetection
- type Status
- type TargetedCommand
- type TargetedSentenceDetection
- type Thanks
- type TimeoutTrigger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface { CommandTrigger Answer(s *discordgo.Session, m *discordgo.MessageCreate) error }
Command a chatbot operation that has specific trigger conditions.
func CreateGlobalCommands ¶
func CreateGlobalCommands() []Command
CreateGlobalCommands create a slice of pre-built global commands.
func CreateTargetedCommands ¶
func CreateTargetedCommands() []Command
CreateTargetedCommands create a slice of pre-built targeted commands.
type CommandTrigger ¶
type CommandTrigger interface {
Trigger(message *discordgo.MessageCreate) bool
}
CommandTrigger a trigger condition.
type GlobalCommand ¶
type GlobalCommand struct { TimeoutTrigger Response string }
GlobalCommand a simple generic command that can be triggered by any user. These commands trigger only once every Timeout.
func NewChangeUsername ¶
func NewChangeUsername() *GlobalCommand
NewChangeUsername create an assistance command for changing username.
func NewChatEmpty ¶
func NewChatEmpty() *GlobalCommand
NewChatEmpty create an assistance command for empty chat.
func NewGameDoesntStart ¶
func NewGameDoesntStart() *GlobalCommand
NewGameDoesntStart create an assistance command for troubleshooting.
func NewGameNotAvailable ¶
func NewGameNotAvailable() *GlobalCommand
NewGameNotAvailable create an assistance command for install without steam
func NewGlobalCommand ¶
func NewGlobalCommand(keywords [][]string, response string) *GlobalCommand
NewGlobalCommand create a new basic targeted command with a default Timeout of 2 hours.
func NewInstallLinux ¶
func NewInstallLinux() *GlobalCommand
NewInstallLinux create an assistance command for installing the game on linux.
func NewQuestCrashes ¶
func NewQuestCrashes() *GlobalCommand
NewQuestCrashes create an assistance command for when quests crash and users need to abandon and retake them.
func NewUpdateLauncher ¶
func NewUpdateLauncher() *GlobalCommand
NewUpdateLauncher create an assistance command for launcher updates.
func (*GlobalCommand) Answer ¶
func (c *GlobalCommand) Answer(s *discordgo.Session, m *discordgo.MessageCreate) error
Answer the message defined in this GlobalCommand.
type Romans ¶
type Romans struct { SentenceDetection // contains filtered or unexported fields }
Romans say romans release date.
type SentenceDetection ¶
type SentenceDetection struct {
Detector *detect.SentenceDetector
}
SentenceDetection a generic command triggered by a SentenceDetector.
func (*SentenceDetection) Trigger ¶
func (s *SentenceDetection) Trigger(message *discordgo.MessageCreate) bool
Trigger returns true if the message matches the trigger criteria for this command.
type Status ¶
type Status struct { SentenceDetection // contains filtered or unexported fields }
Status say game server status when asked.
type TargetedCommand ¶
type TargetedCommand struct { TimeoutTrigger Response string }
TargetedCommand a simple generic command targeted at a single user. These commands trigger only once every Timeout.
func NewTargetedCommand ¶
func NewTargetedCommand(userID string, keywords [][]string, response string) *TargetedCommand
NewTargetedCommand create a new basic targeted command with a default Timeout of 1 hour.
func (*TargetedCommand) Answer ¶
func (c *TargetedCommand) Answer(s *discordgo.Session, m *discordgo.MessageCreate) error
Answer the message defined in this TargetedCommand.
type TargetedSentenceDetection ¶
type TargetedSentenceDetection struct { SentenceDetection TargetUserID string }
TargetedSentenceDetection a SentenceDetection that only triggers if the message is from the user defined in TargetUserID.
func (*TargetedSentenceDetection) Trigger ¶
func (s *TargetedSentenceDetection) Trigger(message *discordgo.MessageCreate) bool
Trigger returns true if the message's author is this command's target and the message matches the trigger criteria.
type Thanks ¶
type Thanks struct {
SentenceDetection
}
Thanks say "you're welcome" when the bot is thanked.
type TimeoutTrigger ¶
type TimeoutTrigger struct { CommandTrigger Timeout time.Duration // contains filtered or unexported fields }
TimeoutTrigger a CommandTrigger wrapper with timeout.
func (*TimeoutTrigger) Trigger ¶
func (c *TimeoutTrigger) Trigger(message *discordgo.MessageCreate) bool
Trigger returns true if the command is not timed out, the message's author is this command's target and the message matches the trigger criteria.