commands

package
v0.0.0-...-90e309b Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Package commands contains all commands that can be run and a command handler.

Index

Constants

This section is empty.

Variables

View Source
var CommandGroups = map[string][]basecommand.Command{
	"7TV":        seventv.Commands[:],
	"Admin":      admin.Commands[:],
	"Bot info":   append([]basecommand.Command{helpCommand}, botinfo.Commands[:]...),
	"Bulk":       bulk.Commands[:],
	"Fun":        fun.Commands[:],
	"Gamba":      gamba.Commands[:],
	"Kick":       kick.Commands[:],
	"Moderation": moderation.Commands[:],
	"Echo":       echo.Commands[:],
	"Twitch":     twitch.Commands[:],
}

CommandGroups contains all groups of commands.

Functions

This section is empty.

Types

type Handler

type Handler struct {

	// Clients are API Clients to use.
	// It is only exported for testing and should not be otherwise used.
	Clients base.APIClients
	// contains filtered or unexported fields
}

Handler handles messages.

func NewHandler

func NewHandler(ctx context.Context, db *gorm.DB, cdb cache.Cache, cfg *config.Config, allPlatforms map[string]base.Platform) Handler

NewHandler creates a new Handler.

func NewHandlerForTest

func NewHandlerForTest(db *gorm.DB, cdb cache.Cache, allPlatforms map[string]base.Platform, newConfigSource func() (io.ReadCloser, error), randOpts base.RandResources, clients base.APIClients) Handler

NewHandlerForTest creates a new Handler for use in testing.

func (*Handler) Handle

func (h *Handler) Handle(msg *base.IncomingMessage) ([]*base.OutgoingMessage, error)

Handle handles incoming messages, possibly returning messages to be sent in response.

Directories

Path Synopsis
Package admin handles bot administration commands.
Package admin handles bot administration commands.
Package basecommand contains shared types and utilities for command handlers.
Package basecommand contains shared types and utilities for command handlers.
Package botinfo implements commands that return info about the bot.
Package botinfo implements commands that return info about the bot.
Package bulk handles commands that perform bulk operations.
Package bulk handles commands that perform bulk operations.
Package commandtest provides helpers for testing commands.
Package commandtest provides helpers for testing commands.
Package echo implements commands that do simple echoes.
Package echo implements commands that do simple echoes.
Package fun implements fun commands that hit APIs.
Package fun implements fun commands that hit APIs.
Package gamba implements gamba commands.
Package gamba implements gamba commands.
Package kick implements Kick commands.
Package kick implements Kick commands.
Package moderation implements moderation commands.
Package moderation implements moderation commands.
Package seventv implements 7TV commands.
Package seventv implements 7TV commands.
Package twitch implements Twitch commands.
Package twitch implements Twitch commands.

Jump to

Keyboard shortcuts

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