irc

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Error   = "ERROR"
	Join    = "JOIN"
	Mode    = "MODE"
	Nick    = "NICK"
	Notice  = "NOTICE"
	Part    = "PART"
	Ping    = "PING"
	Privmsg = "PRIVMSG"
	Quit    = "QUIT"
	Topic   = "TOPIC"

	ReplyWelcome         = "001"
	ReplyYourHost        = "002"
	ReplyCreated         = "003"
	ReplyISupport        = "005"
	ReplyLUserClient     = "251"
	ReplyLUserOp         = "252"
	ReplyLUserUnknown    = "253"
	ReplyLUserChannels   = "254"
	ReplyLUserMe         = "255"
	ReplyAway            = "301"
	ReplyWhoisUser       = "311"
	ReplyWhoisServer     = "312"
	ReplyWhoisOperator   = "313"
	ReplyWhoisIdle       = "317"
	ReplyEndOfWhois      = "318"
	ReplyWhoisChannels   = "319"
	ReplyNoTopic         = "331"
	ReplyTopic           = "332"
	ReplyNamReply        = "353"
	ReplyEndOfNames      = "366"
	ReplyMotd            = "372"
	ReplyMotdStart       = "375"
	ReplyEndOfMotd       = "376"
	ErrErroneousNickname = "432"
	ErrNicknameInUse     = "433"
)

Variables

View Source
var (
	ErrBadProtocol = errors.New("This server does not speak IRC")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	Server            string
	Host              string
	TLS               bool
	TLSConfig         *tls.Config
	Password          string
	Username          string
	Realname          string
	Messages          chan *Message
	ConnectionChanged chan ConnectionState
	HandleNickInUse   func(string) string

	Support *iSupport
	// contains filtered or unexported fields
}

func NewClient

func NewClient(nick, username string) *Client

func (*Client) Away

func (c *Client) Away(message string)

func (*Client) Connect

func (c *Client) Connect(address string)

func (*Client) Connected

func (c *Client) Connected() bool

func (*Client) GetNick

func (c *Client) GetNick() string

func (*Client) Invite

func (c *Client) Invite(nick, channel string)

func (*Client) Join

func (c *Client) Join(channels ...string)

func (*Client) Kick

func (c *Client) Kick(channel string, users ...string)

func (*Client) Mode

func (c *Client) Mode(target, modes, params string)

func (*Client) Nick

func (c *Client) Nick(nick string)

func (*Client) Notice

func (c *Client) Notice(target, msg string)

func (*Client) Oper

func (c *Client) Oper(name, password string)

func (*Client) Part

func (c *Client) Part(channels ...string)

func (*Client) Privmsg

func (c *Client) Privmsg(target, msg string)

func (*Client) Quit

func (c *Client) Quit()

func (*Client) Reconnect

func (c *Client) Reconnect()

func (*Client) Registered

func (c *Client) Registered() bool

func (*Client) Topic

func (c *Client) Topic(channel string, topic ...string)

func (*Client) Whois

func (c *Client) Whois(nick string)

func (*Client) Write

func (c *Client) Write(data string)

func (*Client) Writef

func (c *Client) Writef(format string, a ...interface{})

type ConnectionState

type ConnectionState struct {
	Connected bool
	Error     error
}

type Message

type Message struct {
	Tags    map[string]string
	Prefix  string
	Nick    string
	Command string
	Params  []string
}

func (*Message) LastParam

func (m *Message) LastParam() string

Jump to

Keyboard shortcuts

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