Version info as ctcp action.

This commit is contained in:
Andreas Neue 2016-02-28 13:00:08 +01:00
parent 7f79bc154c
commit 3ac6bf2393
1 changed files with 7 additions and 5 deletions

12
main.go
View File

@ -16,6 +16,7 @@ import (
"github.com/nickvanw/ircx"
"github.com/sorcix/irc"
"github.com/sorcix/irc/ctcp"
"flokatirc/modules"
"flokatirc/version"
@ -106,9 +107,9 @@ func ConnectHandler(s ircx.Sender, m *irc.Message) {
Params: []string{ch},
})
}
time.Sleep(5 * time.Second)
//sayCh <- fmt.Sprintf("%s\n\001ACTION running on %s", "*", SoftwareInfo())
sayCh <- fmt.Sprintf("%s\n%s", "*", SoftwareInfo())
time.Sleep(2 * time.Second)
msg := ctcp.Encode(ctcp.ACTION, fmt.Sprintf("running on %s", SoftwareInfo()))
sayCh <- fmt.Sprintf("%s\n%s", "*", msg)
}
func PingHandler(s ircx.Sender, m *irc.Message) {
@ -133,8 +134,9 @@ func HandleMessage(m *irc.Message) {
}
switch tok[0] {
case "!version":
//sayCh <- fmt.Sprintf("%s\n\001ACTION running on %s", "*", SoftwareInfo())
sayCh <- fmt.Sprintf("%s\n%s", "*", SoftwareInfo())
msg := ctcp.Encode(ctcp.ACTION, fmt.Sprintf("running on %s", SoftwareInfo()))
sayCh <- fmt.Sprintf("%s\n%s", "*", msg)
//sayCh <- fmt.Sprintf("%s\n%s", "*", SoftwareInfo())
default:
}
}