bot

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandInformation

type CommandInformation struct {
	Command     string
	Template    string
	Description string
}

CommandInformation describes a command in available for a plugin.

type IPlugin

type IPlugin interface {
	GetCommands() []CommandInformation
	GetHelpText() string
}

IPlugin interface used by qilbot.

type Plugin

type Plugin struct {
	IPlugin
	Name        string
	Description string
	Qilbot      *Qilbot
	Commands    []CommandInformation
}

Plugin describes a plugin in qilbot.

func (*Plugin) GetCommands

func (plugin *Plugin) GetCommands() []CommandInformation

GetCommands generic implementation for getting commands.

func (*Plugin) GetHelpText

func (plugin *Plugin) GetHelpText() (msg string)

GetHelpText generic implemetation for help text.

type Qilbot

type Qilbot struct {
	BotID string

	Plugins []IPlugin
	// contains filtered or unexported fields
}

Qilbot representation of the instance of qilbot.

func New

func New(config *QilbotConfig) (bot *Qilbot, err error)

New creates a new instance of Qilbot

func (*Qilbot) AddHandler

func (qilbot *Qilbot) AddHandler(handler interface{})

AddHandler Adds an event handler for discord events

func (*Qilbot) AddPlugin

func (qilbot *Qilbot) AddPlugin(plugin IPlugin)

AddPlugin Add a plugin to qilbot that will be initialised with a instance for the discord session.

func (*Qilbot) InDebugMode

func (qilbot *Qilbot) InDebugMode() bool

InDebugMode returns true if qilbot is running in debug mode.

func (*Qilbot) IsBot

func (qilbot *Qilbot) IsBot(id string) bool

IsBot Simple check to see if the an ID matches the bot id.

func (*Qilbot) Start

func (qilbot *Qilbot) Start() (err error)

Start Opens a WebSocket connection with discord.

func (*Qilbot) Stop

func (qilbot *Qilbot) Stop()

Stop not implemented

type QilbotConfig

type QilbotConfig struct {
	Email    string
	Password string
	Token    string
	Debug    bool
}

QilbotConfig representation of the configuration for qilbot.

Jump to

Keyboard shortcuts

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