예제 #1
0
파일: cycat.py 프로젝트: mdoff/muk
def receive(line, bot_socket):
  text = mfunctions.user_text(line)
  if(text and text[1] == "!cycat"):
    mfunctions.say(cycat(),bot_socket)
  elif(text and text[1][:6] == "!cycat" and len(text[1]) > 12):
    add_cycat(text[1][7:])
    mfunctions.say(mconfig.NICK+" dodał cytata (^.^)",bot_socket)
예제 #2
0
파일: eighthball.py 프로젝트: mdoff/muk
def receive(line, bot_socket):
  text = mfunctions.user_text(line)
  if(text):
    if(text[1][:3] == "!8b" and len(text[1]) > 8):
      mfunctions.say(ball(), bot_socket)
    elif(text[1][:3] == "!8b"):
      mfunctions.say('What\'s your question?', bot_socket)
예제 #3
0
파일: bash.py 프로젝트: mdoff/muk
def receive(line, bot_socket):
  text = mfunctions.user_text(line)
  if(text and text[1] == "!bash"):
    t = bash()
    t = t.split('\n')
    for a in t:
      mfunctions.say(a,bot_socket)
예제 #4
0
파일: shorturl.py 프로젝트: mdoff/muk
def receive(line, bot_socket):
  text = mfunctions.user_text(line)
  if(text):
    urls = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', text[1])
    for u in urls:
      if(u[:17] != 'http://www.ircnet'):
        shorten = urlopen('http://to.ly/api.php?longurl='+u).read()
        mfunctions.say(shorten.decode("utf-8"),bot_socket)
예제 #5
0
파일: muki.py 프로젝트: mdoff/muk
def receive(line, bot_socket):
  text = mfunctions.user_text(line)
  if(text):
    if(text[1] == "muk?"):
      mfunctions.say("muk, muk? >.<", bot_socket)
    elif(text[1] == "muk."):
      mfunctions.say("muk, to brzmi dumnie.", bot_socket)
    elif(text[1] == "muk!"):
      mfunctions.say("muk, muk! ^^", bot_socket)
    elif(text[1] == "muk?!"):
      mfunctions.say("mu.. mu.. że muk?!", bot_socket)
    elif(text[1] == "!ping"):
      mfunctions.say("muk, mu.. ee.. pong! ^^\"", bot_socket)
예제 #6
0
파일: ping.py 프로젝트: mdoff/muk
def receive(line, bot_socket):
  lines = line.split(' ')
  text = mfunctions.user_text(line)
  if(lines[0] == "PING"):
    mfunctions.send("PONG %s\r\n" % lines[1],bot_socket)
    print('PONG '+lines[1])
  if(lines[0] == "KICK"):
    mfunctions.send("JOIN "+mconfig.CHANNEL+"\r\n",bot_socket)
  if(text):
    if(text[1] == "!uptime"):
      mfunctions.say(os.popen('uptime').read(),bot_socket)
    elif(text[1] == "!reg"):
          mfunctions.send("PRIVMSG NickServ : IDENTIFY "+mconfig.PASSWORD+"\r\n",bot_socket)
예제 #7
0
파일: slap.py 프로젝트: mdoff/muk
def receive(line, bot_socket):
  text = mfunctions.user_text(line)
  if(text):
    if(text[1][:5] == "!slap" and len(text[1]) > 6 and text[1][6:] != mconfig.NICK):
      mfunctions.say("\x01ACTION "+slap(text[1][6:])+"\x01", bot_socket)
예제 #8
0
파일: hello.py 프로젝트: mdoff/muk
def receive(line, bot_socket):
  lines = line.split(' ')
  if(len(lines) > 2 and lines[1] == 'JOIN'):
    nick = mfunctions.user_nick(line)
    if(nick and nick != mconfig.NICK):
      mfunctions.say(witka(nick), bot_socket)