discordyetanotherremoterunner

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 8 Imported by: 0

README

discord-yet-another-remote-runner

Discord Bot - Yet Another Remote Runner

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

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

func NewBot

func NewBot(t string, c Config) (*Bot, error)

func (*Bot) AddCommands

func (b *Bot) AddCommands(c ...Command)

func (*Bot) Close

func (b *Bot) Close() error

func (*Bot) Config

func (b *Bot) Config() Config

func (*Bot) Open

func (b *Bot) Open() error

func (*Bot) SetConfig

func (b *Bot) SetConfig(c Config)

type Command

type Command interface {
	Name() string
	Description() string
	Build(*Bot) *discordgo.ApplicationCommand
	Handle(*discordgo.Session, *discordgo.InteractionCreate)
}

type CommandBasic

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

func NewCommandBasic

func NewCommandBasic(name, description string, command ConfigCommand) *CommandBasic

func (*CommandBasic) Build

func (c *CommandBasic) Build(bot *Bot) *discordgo.ApplicationCommand

func (*CommandBasic) Description

func (c *CommandBasic) Description() string

func (*CommandBasic) Handle

func (*CommandBasic) Name

func (c *CommandBasic) Name() string

type CommandServer

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

func (*CommandServer) Build

func (*CommandServer) Description

func (c *CommandServer) Description() string

func (*CommandServer) Handle

func (*CommandServer) Name

func (c *CommandServer) Name() string

type Config

type Config struct {
	Guild    string
	Commands map[string]ConfigCommand
	Servers  map[string]ConfigServer
}

func ReadConfig

func ReadConfig(filePath string) (Config, error)

type ConfigCommand

type ConfigCommand struct {
	Cmd  string
	Args []string
}

func (*ConfigCommand) String

func (c *ConfigCommand) String() string

type ConfigServer

type ConfigServer struct {
	Name  string
	Start ConfigCommand
	Stop  ConfigCommand
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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