import zirc, ssl
class Bot(zirc.Client):
def __init__(self):
self.connection = zirc.Socket(wrapper=ssl.wrap_socket)
self.config = zirc.IRCConfig(host="irc.freenode.net",
port=6697,
nickname="zirctest",
ident="bot",
realname="test bot",
channels=["##chat"],
caps=zirc.Caps(zirc.Sasl(username="username", password="password")))
self.connect(self.config)
self.start()
def on_privmsg(self, event, irc):
irc.reply(event, "It works!")
#Or alternatively:
#irc.privmsg(event.target, "It works!")
Bot()
This library implements the IRC protocol, it's an event-driven IRC Protocol framework.
sudo pip install zirc
sudo pip3 install zirc
sudo pip install git+https://github.com/itslukej/zirc.git
sudo pip3 install git+https://github.com/itslukej/zirc.git
Github will contain the latest bug fixes and improvements but sometimes also "bad quality" code.
To use IPv6 with zirc.Socket
, you can use the family socket.AF_INET6
:
import socket
self.connection = zirc.Socket(family=socket.AF_INET6)
Initialize zirc.Socket
with argument socket_class
:
self.connection = zirc.Socket(socket_class=zirc.Proxy(host="localhost", port=1080, protocol=zirc.SOCKS5))
You can find examples for zIRC by me and other users on CodeBottle
Talk to us on #zirc at Freenode
Please discuss code changes that significantly affect client use of the library before merging to the master branch. Change the version in setup.py
ahead if the change should be uploaded to PyPi.