script

package
v0.0.0-...-a45123f Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2014 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPrivate

func AddPrivate(keys ...string)

AddPrivate adds a list of internal keys to the message queue

func Broadcast

func Broadcast(key, val string)

Broadcast the val to the internal key on the message queue

Types

type Manager

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

Manager holds a bunch of scripts and a safe proxy to the bot

func New

func New(ctx noye.Bot) (m *Manager)

New returns a new Manager

func (*Manager) Listen

func (m *Manager) Listen(msg noye.IrcMessage)

Listen takes a noye.IrcMessage and delegates it to the scripts

func (*Manager) LoadFile

func (m *Manager) LoadFile(path string) error

LoadFile tries to load the file located at the path

func (*Manager) LoadScripts

func (m *Manager) LoadScripts(dir string)

LoadScripts tries to load scripts in `dir`

func (*Manager) Reload

func (m *Manager) Reload(name string) error

Reload tries to reload the named script

func (*Manager) ReloadBase

func (m *Manager) ReloadBase() (err error)

ReloadBase reloads the base.js script

func (*Manager) Respond

func (m *Manager) Respond(msg noye.Message)

Respond takes a noye.Message and delegates it to the scripts

func (*Manager) Scripts

func (m *Manager) Scripts() map[string]noye.Script

func (*Manager) Unload

func (m *Manager) Unload(name string) (err error)

Unload tries to remove a named script

func (*Manager) UnloadAll

func (m *Manager) UnloadAll()

UnloadAll tries to unload all of the scripts

type Script

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

Script represents a javascript file, with its commands/callbacks parsed.

func (*Script) Cleanup

func (s *Script) Cleanup()

Cleanup calls all cleanup callbacks

func (*Script) Name

func (s *Script) Name() string

Name returns the scripts name

func (*Script) Path

func (s *Script) Path() string

Path returns the scripts path

func (*Script) Source

func (s *Script) Source() string

Source returns the scripts source code

Jump to

Keyboard shortcuts

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