gruutbot

package module
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2020 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandMessage

type CommandMessage struct {
	Parameters []string
	// contains filtered or unexported fields
}

func NewMessage

func NewMessage(message *discordgo.Message, session *discordgo.Session) *CommandMessage

func (*CommandMessage) GuildInfo added in v0.2.0

func (m *CommandMessage) GuildInfo() (*discordgo.Guild, error)

func (*CommandMessage) Info

func (m *CommandMessage) Info() *discordgo.Message

func (*CommandMessage) Reply

func (m *CommandMessage) Reply(replyMessage string, mentionAuthor bool) (err error)

func (*CommandMessage) SessionInfo added in v0.3.1

func (m *CommandMessage) SessionInfo() *discordgo.Session

type Config

type Config struct {
	Logger   *Logger
	LogLevel *LogLevel
	Token    string
	Prefix   string
	Plugins  string
}

type GruutBot

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

func New

func New(configs ...Config) *GruutBot

func (*GruutBot) Start

func (g *GruutBot) Start()

type LogLevel

type LogLevel string
const (
	TraceLevel LogLevel = "trace"
	DebugLevel LogLevel = "debug"
	InfoLevel  LogLevel = "info"
	WarnLevel  LogLevel = "warn"
	ErrorLevel LogLevel = "error"
	FatalLevel LogLevel = "fatal"
)

type Logger

type Logger interface {
	Trace(v ...interface{})
	Debug(v ...interface{})
	Info(v ...interface{})
	Warn(v ...interface{})
	Error(v ...interface{})
	Fatal(v ...interface{})
	Panic(v ...interface{})
	Tracef(format string, v ...interface{})
	Debugf(format string, v ...interface{})
	Infof(format string, v ...interface{})
	Warnf(format string, v ...interface{})
	Errorf(format string, v ...interface{})
	Fatalf(format string, v ...interface{})
	Panicf(format string, v ...interface{})
	Traceln(v ...interface{})
	Debugln(v ...interface{})
	Infoln(v ...interface{})
	Warnln(v ...interface{})
	Errorln(v ...interface{})
	Fatalln(v ...interface{})
	Panicln(v ...interface{})
}

type Plugin

type Plugin interface {
	Register(manager *PluginManager)
	GetName() string
	GetDescription() string
	GetVersion() string
}

type PluginManager

type PluginManager struct {
	Log Logger
	// contains filtered or unexported fields
}

func GetPluginManager

func GetPluginManager(pluginsPath string, log Logger) *PluginManager

func (*PluginManager) LoadPlugins

func (pm *PluginManager) LoadPlugins() (err error)

func (*PluginManager) RegisterCommand

func (pm *PluginManager) RegisterCommand(command string, f func(CommandMessage, Logger) error) error

func (*PluginManager) RegisterPlugin

func (pm *PluginManager) RegisterPlugin(plugin Plugin)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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