modules

package
v0.0.0-...-d0af5f0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 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 Convert

type Convert struct{}

Convert ...

func (Convert) Run

Run converts Float value from currency to anotherk

type Help

type Help struct{}

Help ..

func (Help) Run

func (h Help) Run(m *discordgo.MessageCreate, s *discordgo.Session, args []string) error

Run returns a discordgo.MessageEmbed for the default help message

type Module

type Module interface {
	// Run takes in a string of arguments of dynamic length.
	// Each module responsible for sending their own discord Objects.
	// Returns:
	// *discordgo.MessageEmbed: Empty if nothing to return
	// interface{}: any state to be saved with the messageID
	Run(m *discordgo.MessageCreate, s *discordgo.Session, args []string) error
}

Module Interface

type Modules

type Modules struct {
	// messageID -> []Structs
	MessageStore map[string]interface{}
	// CommandName -> CommandModule
	ModuleStore  map[string]Module
	HandlerStore []interface{}
}

Modules gives access to the global store for all commands

func NewModules

func NewModules() *Modules

NewModules returns a Modules struct

func (*Modules) AddHandler

func (m *Modules) AddHandler(handler interface{})

AddHandler registers a handler / listener to the discord bot.

func (*Modules) AddModule

func (m *Modules) AddModule(commandName string, commandModule Module)

AddModule registers a module to the discord bot

Jump to

Keyboard shortcuts

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