Documentation
¶
Index ¶
- func Action(w io.Writer, to string, msg ...string)
- func Chat(w io.Writer, to string, msg ...string)
- func CutIRCPrefixMSG(msg string) (after string, found bool)
- func Invite(w io.Writer, channel string, nick ...string)
- func Join(w io.Writer, channel ...string)
- func Kick(w io.Writer, channel, reason string, nick ...string)
- func Mode(w io.Writer, mode ...string)
- func Nick(w io.Writer, nick string)
- func NicknameIsUsed(line string) (used bool)
- func Notice(w io.Writer, to string, msg ...string)
- 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 Action ¶ added in v1.0.13
This will send action message(s) (similar to /me <msg>) to a channel / individual. Example:
irc.Action(conn, "#chat", "Hello world", "This is the second message") irc.Action(conn, "user", "Hey there!") irc.Action(conn, "#chan1,#chan2,user1,user2", "Hey there!")
func Chat ¶
This will send message(s) to a channel / individual. Example:
irc.Chat(conn, "#chat", "Hello world", "This is the second message") irc.Chat(conn, "user", "Hey there!") irc.Chat(conn, "#chan1,#chan2,user1,user2", "Hey there!")
func CutIRCPrefixMSG ¶
func Invite ¶ added in v1.0.13
This will send invite to nick(s) Example:
irc.Invite(conn, "#chat", "User") irc.Invite(conn, "#chat", "User1", "User2")
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 Kick ¶ added in v1.0.13
This will kick member(s) in a channel. Example:
irc.Kick(conn, "#chat", "A reason", "User") irc.Kick(conn, "#chat", "A reason", "User1", "User2")
func Mode ¶ added in v1.0.13
This will send MODE command(s) to a channel / individual. Example:
irc.Mode(conn, "#chat +o User") irc.Mode(conn, "+s") // user mode irc.Mode(conn, "#chat2 +s User", "#chat3 +s User")
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 Notice ¶ added in v1.0.13
This will send notice(s) to a channel / individual. Example:
irc.Notice(conn, "#chat", "Hello world", "This is the second message") irc.Notice(conn, "user", "Hey there!") irc.Notice(conn, "#chan1,#chan2,user1,user2", "Hey there!")
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“