irc

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(raw string) noye.IrcMessage

Parse takes a raw message and turns it into an IrcMessage

func ParseUser

func ParseUser(raw string) noye.User

ParseUser takes a raw user string and returns a User

Types

type Bot

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

Bot encapsulates all the parts to run a bot

func New

func New(conn noye.Conn) *Bot

New takes a noye.Conn and returns a new Bot

func (*Bot) Close

func (b *Bot) Close()

Close attempts to close the bots connection

func (*Bot) Dial

func (b *Bot) Dial(addr, nick, user string) (err error)

Dial takes an address, nick and user string then connects and returns any error

func (*Bot) Join

func (b *Bot) Join(t string)

Join attempts to join the target

func (*Bot) Manager

func (b *Bot) Manager() noye.Manager

Manager returns the script manager

func (*Bot) Part

func (b *Bot) Part(t string)

Part attempts to leave the target

func (*Bot) Privmsg

func (b *Bot) Privmsg(t, msg string)

Privmsg sends the 'msg' to the target as a privmsg

func (*Bot) Quit

func (b *Bot) Quit()

Quit closes the connection

func (*Bot) Ready

func (b *Bot) Ready() <-chan struct{}

func (*Bot) Send

func (b *Bot) Send(f string, a ...interface{})

Send sends a formatted string to the connection

func (*Bot) Wait

func (b *Bot) Wait() <-chan struct{}

Wait returns a channel that'll be closed when the bot dies

type Connection

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

Connection is a simple connection to an irc server

func (*Connection) Close

func (c *Connection) Close()

Close closes the connection

func (*Connection) Dial

func (c *Connection) Dial(addr string) (err error)

Dial uses a provided addr:port and opens a connection, returning any error

func (*Connection) ReadLine

func (c *Connection) ReadLine() (string, error)

ReadLine returns a string, error after reading the next line from the connection

func (*Connection) WriteLine

func (c *Connection) WriteLine(raw string)

WriteLine writes the 'raw' string to the connection

type Signal

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

Signal is a single-use blocking channel

func NewSignal

func NewSignal() *Signal

NewSignal returns a new Signal

func (*Signal) Close

func (s *Signal) Close()

Close closes the channel, only once

func (*Signal) Done

func (s *Signal) Done() bool

Done returns whether the signal has been closed

func (*Signal) Wait

func (s *Signal) Wait() <-chan struct{}

Wait returns the internal channel

Jump to

Keyboard shortcuts

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