From 80d8cd4ea76eb39e24fb0c7bd4ba309cb5eb1738 Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Wed, 9 Nov 2011 22:06:54 +0000 Subject: [PATCH] Update README and example client once more. --- README.md | 10 ++++++---- client.go | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ee76171..fc6c8dc 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Synopsis: func main() { flag.Parse() // parses the logging flags. - c := irc.New("nick", "ident", "real name", false, nil, nil) + c := irc.SimpleClient("nick") // Optionally, enable SSL c.SSL = true @@ -55,9 +55,11 @@ the messages from the IRC server, so you have to handle e.g. "332" for The vast majority of handlers implemented within the framework deal with state tracking of all nicks in any channels that the client is also present in. These -handers are in `client/state_handlers.go`. State tracking is optional, and can -be enabled by passing `true` as the fourth argument to `client.New()`. This API -sucks and may change in the future. +handers are in `client/state_handlers.go`. State tracking is optional, disabled +by default, and can be enabled and disabled by calling `EnableStateTracking()` +and `DisableStateTracking()` respectively. Doing this while connected to an IRC +server will probably result in an inconsistent state and a lot of warnings to +STDERR ;-) ### Misc. diff --git a/client.go b/client.go index e0e18a5..cb8d02f 100644 --- a/client.go +++ b/client.go @@ -16,7 +16,8 @@ func main() { flag.Parse() // create new IRC connection - c := irc.New("GoTest", "gotest", "GoBot", true, nil, nil) + c := irc.SimpleClient("GoTest", "gotest") + c.EnableStateTracking() c.AddHandler("connected", func(conn *irc.Conn, line *irc.Line) { conn.Join(*channel) })