No project description provided
Project description
ircstates
usage
example code
import ircstates, ircevents, socket
NICK = "nickname"
CHAN = "#chan"
HOST = "127.0.0.1"
POST = 6667
server = ircstates.Server("freenode")
sock = socket.socket()
sock.connect((HOST, POST))
def _send(s):
line = irctokens.tokenise(s)
server.send(line)
_send("USER test 0 * :test")
_send("NICK test321")
while True:
while server.pending():
send_lines = server.sent(sock.send(server.pending()))
for line in send_lines:
print(f"> {line.format()}")
recv_lines = server.recv(sock.recv(1024))
for line in recv_lines:
print(f"< {line.format()}")
# user defined behaviors...
if line.command == "001" and not "#test321" in server.channels:
_send("JOIN #test321")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ircevents-0.1.0.tar.gz
(1.6 kB
view hashes)
Built Distribution
Close
Hashes for ircevents-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bf430b16d7f0fcf4fbc520a81c30007669977a215899ffa771329aa14f56e9a |
|
MD5 | 4d4c15f969fe02725dcad4984b52ca02 |
|
BLAKE2b-256 | 9267ec309d6b6d5cdeb99768bf493cb98ae1da8186ea0775cc30a1e003ce0d11 |