Giter VIP home page Giter VIP logo

zirc's Introduction

#Internet Relay Chat (IRC) Protocol client library Build Status

###Quick Start

import zirc, ssl

class Bot(zirc.Client):
    def __init__(self):
        self.connection = zirc.Socket(wrapper=ssl.wrap_socket)
        self.connect(address="irc.freenode.net", 
            port=6697,
            nickname="zirctest",
            ident="bot",
            realname="test bot",
            channels=["##chat"],
            sasl_user="NickServ_Username",
            sasl_pass="NickServ_Password")
        
        self.start()
        
    def on_privmsg(bot, event, irc):
        irc.reply(event, "It works!")
        #Or alternatively:
        #irc.privmsg(event.target, "It works!")

Bot()

This library implements IRC protocol, It's an event-driven IRC Protocol framework.

#Installation

####PyPi

sudo pip install zirc
sudo pip3 install zirc

####Github:

sudo pip install git+https://github.com/itslukej/zirc.git
sudo pip3 install git+https://github.com/itslukej/zirc.git

Github will contain latest bug fixes and improvements but sometimes also "bad quality" code.

#Features

  • Automatic PING/PONG between the server
  • IRC Message parsing
  • A simple set up and connection method
  • Easy installation
  • Easy CTCP Set-up

#IPv6

To use IPv6 with zirc.Socket, you can use the family socket.AF_INET6:

import socket

self.connection = zirc.Socket(family=socket.AF_INET6)

#Proxy

Replace self.connection's attribute sock to use a proxy with zirc.Socket:

import socks

self.connection = zirc.Socket()
self.connection.sock = socks.socksocket()
self.connection.sock.set_proxy(socks.SOCKS5, "proxy_ip", 1080)

#Ideas

  • Multiple connection support

#TODO

  • More documentation

#Contributing

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.

zirc's People

Contributors

itslukej avatar wolfy1339 avatar

Watchers

James Cloos avatar Bradley Bellairs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.