Version info as ctcp action.
This commit is contained in:
parent
7f79bc154c
commit
3ac6bf2393
12
main.go
12
main.go
|
@ -16,6 +16,7 @@ import (
|
||||||
|
|
||||||
"github.com/nickvanw/ircx"
|
"github.com/nickvanw/ircx"
|
||||||
"github.com/sorcix/irc"
|
"github.com/sorcix/irc"
|
||||||
|
"github.com/sorcix/irc/ctcp"
|
||||||
|
|
||||||
"flokatirc/modules"
|
"flokatirc/modules"
|
||||||
"flokatirc/version"
|
"flokatirc/version"
|
||||||
|
@ -106,9 +107,9 @@ func ConnectHandler(s ircx.Sender, m *irc.Message) {
|
||||||
Params: []string{ch},
|
Params: []string{ch},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
time.Sleep(5 * time.Second)
|
time.Sleep(2 * time.Second)
|
||||||
//sayCh <- fmt.Sprintf("%s\n\001ACTION running on %s", "*", SoftwareInfo())
|
msg := ctcp.Encode(ctcp.ACTION, fmt.Sprintf("running on %s", SoftwareInfo()))
|
||||||
sayCh <- fmt.Sprintf("%s\n%s", "*", SoftwareInfo())
|
sayCh <- fmt.Sprintf("%s\n%s", "*", msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
func PingHandler(s ircx.Sender, m *irc.Message) {
|
func PingHandler(s ircx.Sender, m *irc.Message) {
|
||||||
|
@ -133,8 +134,9 @@ func HandleMessage(m *irc.Message) {
|
||||||
}
|
}
|
||||||
switch tok[0] {
|
switch tok[0] {
|
||||||
case "!version":
|
case "!version":
|
||||||
//sayCh <- fmt.Sprintf("%s\n\001ACTION running on %s", "*", SoftwareInfo())
|
msg := ctcp.Encode(ctcp.ACTION, fmt.Sprintf("running on %s", SoftwareInfo()))
|
||||||
sayCh <- fmt.Sprintf("%s\n%s", "*", SoftwareInfo())
|
sayCh <- fmt.Sprintf("%s\n%s", "*", msg)
|
||||||
|
//sayCh <- fmt.Sprintf("%s\n%s", "*", SoftwareInfo())
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue