From 533177a49056870647b39b47403f2acf9bfa4b60 Mon Sep 17 00:00:00 2001 From: Tyler Sommer Date: Thu, 23 Oct 2014 18:17:58 -0700 Subject: [PATCH] Added Connected method --- irc.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/irc.go b/irc.go index 64194d7..3426b08 100644 --- a/irc.go +++ b/irc.go @@ -294,6 +294,11 @@ func (irc *Connection) ErrorChan() chan error { return irc.Error } +// Returns true if the connection is connected to an IRC server. +func (irc *Connection) Connected() bool { + return !irc.stopped +} + // A disconnect sends all buffered messages (if possible), // stops all goroutines and then closes the socket. func (irc *Connection) Disconnect() {