cmd

package
v0.0.0-...-9f27d82 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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

Answer the message defined in this GlobalCommand.

type Romans

type Romans struct {
	SentenceDetection
	// contains filtered or unexported fields
}

Romans say romans release date.

func NewRomans

func NewRomans() *Romans

NewRomans create a new Romans command.

func (*Romans) Answer

Answer the 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.

func NewStatus

func NewStatus() *Status

NewStatus create a new Thanks command.

func (*Status) Answer

Answer the game server status.

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

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

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.

func NewThanks

func NewThanks() *Thanks

NewThanks create a new Thanks command.

func (*Thanks) Answer

Answer "you're welcome".

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.

Jump to

Keyboard shortcuts

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