Example #1
0
File: cycat.py Project: 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)
Example #2
0
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)
Example #3
0
File: bash.py Project: 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)
Example #4
0
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)
Example #5
0
File: muki.py Project: 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)
Example #6
0
File: ping.py Project: 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)
Example #7
0
File: slap.py Project: 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)