getSocket: Use returned family to create the socket

The existing code was parsing the passed in host to determine what type
of socket family to create.  getaddrinfo already provides this for us,
so there's no need to perform our own, potentially buggy, parsing.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
Socket: Try all resolved addresses before scheduling a reconnect

Instead of assuming the first address returned from getaddrinfo can be
reached, try each one in turn until a connection is established.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
commands.py: Fix error message of getSomethingWithoutSpaces.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
supybot-botchk: Directly execute supybot instead of running it in sh

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
Fix crash if a custom error message is provided to somethingWithoutSpaces

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
Provide a default help message for commands without help.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
Only reset the cached feed when the response actually contains headlines

Some feeds, such as those from sourceforge.net, will sometimes show an error
page rather than a feed. In this case the feed cache used to be cleared for
that feed, causing all 'old' headlines to be flooded to the channel as soon
as the feed came back online.

This patch hopefully fixes that by only resetting the cache when the returned
page actually contains headlines.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
commands: Handle OverflowError in _int

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
RSS: Ensure results is declared before trying to access it

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
Socket: Match the expected API of reconnect

driver.reconnect(wait=True) should flag a driver to reconnect, but not
immediately.  The Socket driver lost its handling of this flag in
8730832e.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
ShrinkUrl: Fix the check for ur1ca results.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
Fix use of rsplit for IPv6 addresses.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
Factoids: Fix help of @random.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
Prevent exception when replying with a genericNoCapability error

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>