Skip to main content

No project description provided

Project description

ircstates

Build Status

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


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)

Uploaded Source

Built Distribution

ircevents-0.1.0-py3-none-any.whl (2.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page