don't track our test script
This commit is contained in:
parent
59ca9f8251
commit
786e99d743
@ -1,34 +0,0 @@
|
|||||||
// nmdc project main.go
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"libnmdc"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
|
|
||||||
opts := libnmdc.HubConnectionOptions{
|
|
||||||
Address: "127.0.0.1:411",
|
|
||||||
Self: libnmdc.UserInfo{Nick: "slowpoke9"},
|
|
||||||
}
|
|
||||||
hub := opts.Connect()
|
|
||||||
|
|
||||||
for {
|
|
||||||
event := <-hub.OnEvent
|
|
||||||
switch event.EventType {
|
|
||||||
case libnmdc.EVENT_CONNECTION_STATE_CHANGED:
|
|
||||||
fmt.Printf("Connection -- %s\n", event.StateChange.Format())
|
|
||||||
|
|
||||||
case libnmdc.EVENT_PUBLIC:
|
|
||||||
fmt.Printf("Message from '%s': '%s'\n", event.Nick, event.Message)
|
|
||||||
if event.Message == "how are you" {
|
|
||||||
hub.SayPublic("good thanks!")
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
fmt.Printf("%+v\n", event)
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user