Exemplo n.º 1
0
def leave(text, irc, ex, nick, commands):
    c = text.split(":!leave ")[1].strip()
    rawsend(irc,'PART '+ c +'\r\n')
Exemplo n.º 2
0
def join(text, irc, ex, nick, commands):
    c = text.split(":!join ")[1].strip()
    rawsend(irc,'JOIN '+ c +'\r\n')
Exemplo n.º 3
0
def quit(text, irc, ex, nick, commands):
    sendm(irc,'see you, space cowboy', ex[2])
    rawsend(irc,'QUIT :h\r\n')
    exit()
Exemplo n.º 4
0
def PING(text, irc, ex, nick, commands):
    rawsend(irc,'PONG ' + text.split()[1] + '\r\n')
Exemplo n.º 5
0
        if operonly and nick not in GS["owners"]:
            sendm(irc, nick + ": you're not on the operator list.", ex[2])
        else:
            print(" running: " + plugin)
            getattr(Modules, "%s" % plugin)(text, irc, ex, nick, commands)


irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
irc.connect((GS["connect"]["host"], GS["connect"]["port"]))

rawsend(
    irc,
    "USER "
    + GS["connect"]["username"]
    + " "
    + GS["connect"]["hostname"]
    + " "
    + GS["connect"]["servername"]
    + " :"
    + GS["connect"]["realname"]
    + "\n",
)
rawsend(irc, "NICK " + GS["connect"]["nick"] + "\n")
rawsend(irc, "PRIVMSG NickServ :IDENTIFY " + GS["connect"]["nickpass"] + "\n")
rawsend(irc, "JOIN " + GS["connect"]["channels"] + "\n")

while 1:
    text = irc.recv(2040)
    if not text:
        break

    text = utf(text)