Skip to content

Commit

Permalink
Allow running bot on IPv6
Browse files Browse the repository at this point in the history
  • Loading branch information
bdrewery authored and markpasc committed Sep 24, 2011
1 parent efe3de6 commit 1edcf7d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ircbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SingleServerIRCBot(SimpleIRCClient):
have operator or voice modes. The "database" is kept in the
self.channels attribute, which is an IRCDict of Channels.
"""
def __init__(self, server_list, nickname, realname, reconnection_interval=60, localaddress=""):
def __init__(self, server_list, nickname, realname, reconnection_interval=60, localaddress="", ipv6=0):
"""Constructor for SingleServerIRCBot objects.
Arguments:
Expand Down Expand Up @@ -72,6 +72,7 @@ def __init__(self, server_list, nickname, realname, reconnection_interval=60, lo
self._nickname = nickname
self._realname = realname
self._localaddress = localaddress
self._ipv6 = ipv6
for i in ["disconnect", "join", "kick", "mode",
"namreply", "nick", "part", "quit"]:
self.connection.add_global_handler(i,
Expand All @@ -95,7 +96,8 @@ def _connect(self):
self._nickname,
password,
ircname=self._realname,
localaddress=self._localaddress)
localaddress=self._localaddress,
ipv6=self._ipv6)
except ServerConnectionError:
pass

Expand Down

0 comments on commit 1edcf7d

Please sign in to comment.