Created
August 22, 2016 12:51
-
-
Save knight-ryu12/70d3e618e3a19079c4672b82056941cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ircsock: | |
#IRC = socket.socket(socket.AF_INET,socket.SOCK_STREAM) | |
def __init__(self): | |
self.IRC = socket.socket(socket.AF_INET,socket.SOCK_STREAM) | |
def connect(self): | |
self.IRC.connect(("irc.esper.net", 6667)) | |
def send_data(self,command): | |
self.IRC.send((command + '\r\n').encode()) | |
print((command + '\r\n').encode()) | |
def join(self,channel): | |
self.send_data("JOIN %s" % channel) | |
def login(self,nickname,mode,hostname,realname): | |
self.send_data(("USER %s %s %s :%s" % (nickname,mode,hostname,realname))) | |
self.send_data(("NICK %s" % (nickname))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment