forked from an/flokati
Display version and build number.
This commit is contained in:
parent
b7f88b7a9d
commit
e05446aa34
13
main.go
13
main.go
|
@ -8,6 +8,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
@ -15,6 +16,8 @@ import (
|
||||||
"github.com/nickvanw/ircx"
|
"github.com/nickvanw/ircx"
|
||||||
"github.com/sorcix/irc"
|
"github.com/sorcix/irc"
|
||||||
|
|
||||||
|
"flokatirc/version"
|
||||||
|
|
||||||
modfortune "flokatirc/modules/fortune"
|
modfortune "flokatirc/modules/fortune"
|
||||||
modnews "flokatirc/modules/news"
|
modnews "flokatirc/modules/news"
|
||||||
modsaytime "flokatirc/modules/saytime"
|
modsaytime "flokatirc/modules/saytime"
|
||||||
|
@ -35,8 +38,12 @@ func init() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
sayCh chan string
|
||||||
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
sayCh := make(chan string, 1024)
|
sayCh = make(chan string, 1024)
|
||||||
|
|
||||||
//bot := ircx.Classic(*server, *name)
|
//bot := ircx.Classic(*server, *name)
|
||||||
cfg := ircx.Config{User: *name, MaxRetries: 1000}
|
cfg := ircx.Config{User: *name, MaxRetries: 1000}
|
||||||
|
@ -117,6 +124,10 @@ func ConnectHandler(s ircx.Sender, m *irc.Message) {
|
||||||
Params: []string{ch},
|
Params: []string{ch},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
go func() {
|
||||||
|
time.Sleep(10 * time.Second)
|
||||||
|
sayCh <- fmt.Sprintf("%s\nflokati %s-%d", "*", version.FlokatiVersion, version.FlokatiBuild)
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
func PingHandler(s ircx.Sender, m *irc.Message) {
|
func PingHandler(s ircx.Sender, m *irc.Message) {
|
||||||
|
|
Loading…
Reference in New Issue