Documentation
¶
Index ¶
- func Chat(w io.Writer, channel string, msg ...string)
- func CutIRCPrefixMSG(msg string) (after string, found bool)
- func Join(w io.Writer, channel ...string)
- func Nick(w io.Writer, nick string)
- func NicknameIsUsed(line string) (used bool)
- func Part(w io.Writer, reason string, channel ...string)
- func Pong(w io.Writer, line string) (ponged bool)
- func Quit(w io.Writer, reason string)
- func RegisterUser(w io.Writer, username, realname string)
- func Send(w io.Writer, cmd ...string) (err error)
- func Welcome(line string) (welcomed bool)
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chat ¶
This will send a message to a channel / individual. Example:
irc.Chat(conn, "#chat", "Hello world", "This is the second message") irc.Chat(conn, "user", "Hey there!")
func CutIRCPrefixMSG ¶
func Join ¶
This will send a command to join channel(s). Example:
irc.Join(conn, "#chat", "#yonle") irc.Join(conn, "#secret tralalala") // assuming this channel's key is "tralalala"
func NicknameIsUsed ¶
This will check whenever an nickname has already been used Example:
for buf.Scan() { line := buf.Text() if irc.NicknameIsUsed(line) { irc.Nick(conn, "NewNick") continue } }
func Part ¶ added in v1.0.3
This is for leaving / parting channel. Example:
irc.Part(conn, "bye-bye~", "#chat", "#yonle")
func Pong ¶
This will automaticallg reply to PING messages from server. Example:
for buf.Scan() { line := buf.Text() if irc.Pong(line) { continue } }
func Quit ¶ added in v1.0.3
This is for sending `QUIT` message to server. Example:
irc.Quit(conn, "Bot power off")
func RegisterUser ¶
This will send `USER` param to server. `hostname“
Types ¶
Click to show internal directories.
Click to hide internal directories.