plugins

package
v0.0.0-...-326f088 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2018 License: MIT Imports: 4 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Plugins is a map of all plugins for the bot
	Plugins = make(map[string]*Plugin)
	// Prefix is the prefix of all commands for the bot
	Prefix string

	// InfChan for information
	InfChan = make(chan string)
	// WarnChan for warnings
	WarnChan = make(chan error)
	// ErrChan for errors that are not fatal
	ErrChan = make(chan error)
	// FatalChan for errors that are fatal
	FatalChan = make(chan error)

	// SoundQueue is a queue for sound being played
	SoundQueue = make(chan *Sound)
	// SkipSiq is a signal to skip the currently playing item
	SkipSig = make(chan interface{})

	// Config for plugins to use
	Config *config.TomlConfig
)

Functions

func PlayQueue

func PlayQueue()

PlayQueue plays the queue

func Register

func Register(name string, help Help, action interface{}) interface{}

Register registers the plugin with the bot

func StartQueue

func StartQueue() interface{}

StartQueue starts the queue

Types

type Help

type Help struct {
	// A map of commands and their uses
	Commands map[string]string

	// If true the commands defined will be showed when help is called
	View bool

	// A explanation of the plugin
	Explanation string
}

Help is a collection of some useful fields for users

type Plugin

type Plugin struct {
	Action interface{}

	Help    Help
	Name    string
	Enabled bool
}

Plugin is a wrapper for a discordgo handler

type Sound

type Sound struct {
	Content [][]byte

	GuildID        string
	VoiceChannelID string
	Session        *discordgo.Session

	Name          string
	Author        string
	TextChannelID string
	View          bool
}

Sound is a wrapper for encoded bytes

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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