botnettesting/irc2.go
2019-03-27 00:32:45 +00:00

36 lines
772 B
Go

package main
import (
"github.com/thoj/go-ircevent"
"fmt"
"syscalls.go"
)
var RoomName = "#test"
func main() {
con := irc.IRC("filippi", "filippi") //con is connection
err := con.Connect("irc.anarchyplanet.org:6667")
if err != nil {
fmt.Println("U FAIL! TYPO?")
return }
con.AddCallback("001", func (e *irc.Event) {
con.Join(RoomName)
})
con.AddCallback("JOIN", func (e *irc.Event) {
con.Privmsg(RoomName, "Hello! I am a friendly IRC bot who will echo everything you say.")
})
con.AddCallback("PRIVMSG", func (e *irc.Event) {
if e.Message() == "TEST"{
con.Privmsg(RoomName, "BOO")
fmt.Println(e.Message())}
})
con.Loop() //keep the bot 'con' alive
}