irc

package module
v0.0.0-...-0e434f1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//IrcVersion exports the current version of the irc lib
	IrcVersion = "0.1.1776"
)

Variables

This section is empty.

Functions

func GetNick

func GetNick(name string) string

GetNick gets the nickname portion of a host string

Types

type Connection

type Connection struct {
	Sock            net.Conn
	DirectCallback  func(string, string)
	PrivmsgCallback func(string, string, string)
	JoinCallback    func(string, string)
	QuitCallback    func(string, string)
	PartCallback    func(string, string, string)
	NickCallback    func(string, string)
	NumericCallback func(string, int, string)
	// contains filtered or unexported fields
}

Connection holds the callbacks for the client

func NewConnection

func NewConnection(server, nick, user string, pass *string, chans []string) *Connection

NewConnection creates and connects an Connection

func (*Connection) DelayedSend

func (c *Connection) DelayedSend(sock net.Conn, dur time.Duration, channel, msg string)

DelayedSend sends a privmsg AFTER the specified delay

func (*Connection) GetNicks

func (c *Connection) GetNicks(channel string) []string

GetNicks returns a array of all nicks in a channel

func (*Connection) Kill

func (c *Connection) Kill()

Kill terminates the event loop of connection

func (*Connection) Run

func (c *Connection) Run()

Run runs the irc event loop

func (*Connection) SendJoin

func (c *Connection) SendJoin(channel string)

SendJoin sends a JOIN

func (*Connection) SendNames

func (c *Connection) SendNames(channel string)

SendNames sends a NAMES request for the channel

func (*Connection) SendNick

func (c *Connection) SendNick(nick string)

SendNick changes the clients nick

func (*Connection) SendNotice

func (c *Connection) SendNotice(channel, msg string)

SendNotice sends a notice to channel/target

func (*Connection) SendPart

func (c *Connection) SendPart(channel, msg string)

SendPart sends a PART

func (*Connection) SendPass

func (c *Connection) SendPass(pass string)

SendPass sends a PASS for network

func (*Connection) SendPong

func (c *Connection) SendPong(ping string)

SendPong replies to the received PING

func (*Connection) SendPrivmsg

func (c *Connection) SendPrivmsg(channel, msg string)

SendPrivmsg sends a privmsg to channel/target

func (*Connection) SendQuit

func (c *Connection) SendQuit(msg string)

SendQuit sends a QUIT

func (*Connection) SendRaw

func (c *Connection) SendRaw(msg string) error

SendRaw sends a string as a raw irc message

func (*Connection) SendUser

func (c *Connection) SendUser(user, realname string)

SendUser sends a USER command for the network

Jump to

Keyboard shortcuts

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