From 8507128dc63b0d9e47f5cc6787452328812aa706 Mon Sep 17 00:00:00 2001 From: Gisle Aune Date: Sat, 10 Nov 2018 10:59:17 +0100 Subject: [PATCH] client: Misc cleanups and added 'hook.ready' event. --- client.go | 3 ++- config.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index 6e281d5..bebd506 100644 --- a/client.go +++ b/client.go @@ -658,7 +658,7 @@ func (client *Client) handleEvent(event *Event) { message += " :" + event.Text } - client.Send(message + "") + client.Send(message) } // Client Registration @@ -1059,6 +1059,7 @@ func (client *Client) handleEvent(event *Event) { client.Sendf("JOIN %s", strings.Join(channels, ",")) client.EmitNonBlocking(rejoinEvent) + client.EmitNonBlocking(NewEvent("hook", "ready")) } } diff --git a/config.go b/config.go index dbcad75..1429238 100644 --- a/config.go +++ b/config.go @@ -25,11 +25,11 @@ type Config struct { SkipSSLVerification bool `json:"skipSslVerification"` // The Password used upon connection. This is not your NickServ/SASL password! - Password string + Password string `json:"password"` // The rate (lines per second) to send with Client.SendQueued. Default is 2, which is how // clients that don't excess flood does it. - SendRate int + SendRate int `json:"sendRate"` } // WithDefaults returns the config with the default values