Advertisement
Guest User

Untitled

a guest
May 13th, 2016
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 7.61 KB | None | 0 0
  1. #!/usr/bin/python
  2. import ch
  3. import random
  4. import sys
  5. import re
  6. from random import randint
  7. if sys.version_info[0] > 2:
  8.   import urllib.request as urlreq
  9. else:
  10.   import urllib2 as urlreq
  11.  
  12. class TestBot(ch.RoomManager):
  13.   def onInit(self):
  14.     self.setNameColor("F9F")
  15.     self.setFontColor("F33")
  16.     self.setFontFace("1")
  17.     self.setFontSize(10)
  18.     self.enableBg()
  19.     self.enableRecording()
  20.  
  21.   def onMessage(self, room, user, message):
  22.    try:
  23.     if room.getLevel(self.user) > 0:
  24.       print(user.name, message.body)
  25.     else:
  26.       print(user.name, message.body)
  27.     if self.user == user: return
  28.     if message.body[0] == ".":   ##Here is the Prefix part
  29.       data = message.body[1:].split(" ", 1)
  30.       if len(data) > 1:
  31.         cmd, args = data[0], data[1]
  32.       else:
  33.         cmd, args = data[0], ""
  34.  
  35. x1= ['What year is it?',
  36.         '>TFW no ralfjack',
  37.         'No bully ;-;',
  38.         'This movie sucks.',
  39.         'Are you an alcoholic?',
  40.         'What do you think about Donald Trump?',
  41.         ]
  42.  
  43. conch= ['Maybe someday.',
  44.         'Do nothing.',
  45.         'I dont think so.',
  46.         'No.',
  47.         'Yes.',
  48.         'It is certain.',
  49.         ]
  50.  
  51.  
  52. judge = ['http://i.imgur.com/2049sdQ.png',
  53.         'http://i.imgur.com/4qiQJ0t.png',
  54.         'http://i.imgur.com/i1IvTY5.png',
  55.         'http://i.imgur.com/8rtFJg9.png',
  56.         'http://i.imgur.com/q3rWsyK.png',
  57.         'http://i.imgur.com/cdyBlFU.png',
  58.         'http://i.imgur.com/8qDEi0X.png',
  59.         'http://i.imgur.com/I18qikm.png',
  60.         'http://i.imgur.com/XzKYeOl.png',
  61.         'http://i.imgur.com/XDV8you.png',
  62.         ]
  63.  
  64. jojo = ['http://i.imgur.com/IQtjkM2.jpg',
  65.         'http://i.imgur.com/1yzW8gF.jpg',
  66.         'http://i.imgur.com/QjDd6Kc.jpg',
  67.         'http://i.imgur.com/dvbrzKP.jpg',
  68.         'http://i.imgur.com/GePQ5Xf.jpg',
  69.         'http://i.imgur.com/N4lmUpQ.jpg',
  70.         'http://i.imgur.com/WZMIjxi.jpg',
  71.         'http://i.imgur.com/nRqvpVS.png',
  72.         'http://i.imgur.com/q21lDdw.jpg',
  73.         'http://i.imgur.com/jdyR6rE.jpg',
  74.         'http://i.imgur.com/uaHYOau.jpg',
  75.         'http://i.imgur.com/D9729HQ.jpg',
  76.         'http://i.imgur.com/y9N7lNM.jpg',
  77.         'http://i.imgur.com/KOrqDes.jpg',
  78.         'http://i.imgur.com/3ffsEVj.png',
  79.         'http://i.imgur.com/UILZlrz.jpg',
  80.         'http://i.imgur.com/aCBga9t.jpg',
  81.         'http://i.imgur.com/KTLijuq.png',
  82.         ]
  83.  
  84. class TestBot(ch.RoomManager):
  85.   def onInit(self):
  86.     self.setNameColor("6633FF")
  87.     self.setFontColor("6633FF")
  88.     self.setFontFace("0")
  89.     self.setFontSize(14)
  90.     self.enableBg()
  91.     self.enableRecording()
  92.    
  93.   def onConnect(self, room):
  94.     print("Connected to "+room.name)
  95.  
  96.   def onReconnect(self, room):
  97.     print("Reconnected to "+room.name)
  98.  
  99.   def onDisconnect(self, room):
  100.     print("Disconnected from "+room.name)
  101.  
  102.   def onMessage(self, room, user, message):
  103.     # Use with PsyfrBot framework? :3
  104.     self.safePrint(user.name + ': ' + message.body)
  105.  
  106.     if message.body.startswith("!cmds"):
  107.       room.message("commands: !conch !lulz !magestream !randomuser !hack !spooky !tfw !ayylmao !wewlad !flip !normies !loveme !shitmovie !mexico !rate !conch")
  108.  
  109.     if message.body.startswith("!magestream"):
  110.         room.message(random.choice(jojo))
  111.  
  112.     if message.body.startswith("!conch"):
  113.         room.message(random.choice(conch))
  114.  
  115.     if message.body.startswith("!judge"):
  116.         room.message(random.choice(judge))
  117.  
  118. #################
  119. # golora ai #####
  120.  
  121.     try:
  122.         cmd, args = message.body.split(" ", 1)
  123.     except:
  124.         cmd, args = message.body, ""
  125.  
  126.     if cmd[0] == "!":
  127.         prfx = True
  128.         cmd = cmd[1:]
  129.     else:
  130.         prfx = False
  131.  
  132.     if cmd.lower() == "test" and prfx:
  133.         room.message("This is a test code.")
  134.  
  135.  
  136. ################
  137. # cmds #########
  138.  
  139.     if message.body.startswith("@golora"):
  140.         room.message(random.choice(x1))
  141.  
  142.     if message.body.startswith("where is"):
  143.         room.message('dunno, ' + user.name + ' loves ' + args +'.')
  144.  
  145.     if message.body.startswith("!penis"):
  146.       room.message("https://www.youtube.com/watch?v=0hrM2biD7g4")
  147.  
  148.     if message.body.startswith("!scandilove"):
  149.       room.message("http://i.imgur.com/sL5YhsN.gif http://i.imgur.com/8pC5gSu.gif http://i.imgur.com/LVi3PVW.gif")
  150.  
  151.     if message.body.startswith("!baltlove"):
  152.       room.message("http://i.imgur.com/oStDCw5.gif http://i.imgur.com/8pC5gSu.gif http://i.imgur.com/1J0TUpN.gif")
  153.  
  154.     if message.body.startswith("!nalove"):
  155.       room.message("http://i.imgur.com/MQDW25V.gif http://i.imgur.com/8pC5gSu.gif http://i.imgur.com/tUln5pi.gif")
  156.  
  157.     if message.body.startswith("!slavlove"):
  158.       room.message("http://i.imgur.com/BKCSyCA.gif http://i.imgur.com/8pC5gSu.gif http://i.imgur.com/56q2ZRN.gif")
  159.  
  160.     if message.body.startswith("!epic"):
  161.       room.message("https://www.youtube.com/watch?v=_yThfdrdFL8")
  162.  
  163.     if message.body.startswith("!dance"):
  164.       room.message("http://i.imgur.com/OgDXHh7.gif")
  165.  
  166.     if message.body.startswith("!clock"):
  167.       room.message("http://ichef.bbci.co.uk/news/976/cpsprodpb/8123/production/_85595033_clock_irving_police_ap.jpg")
  168.  
  169.     if message.body.startswith("!shoe"):
  170.       room.message("http://imgur.com/a/Bh8iH")
  171.  
  172.     if message.body.startswith("!ci"):
  173.       room.message("http://i.imgur.com/t1DCBEL.png")
  174.  
  175.     if message.body.startswith("!hack"):
  176.       room.message("http://i.imgur.com/2rhkZZr.gif http://i.imgur.com/2rhkZZr.gif http://i.imgur.com/2rhkZZr.gif")
  177.  
  178.     if message.body.startswith("!ban"):
  179.       room.message("BANNED!")
  180.  
  181.     if message.body.startswith("!superban"):
  182.       room.message("SUPERBANNED!")
  183.  
  184.     if message.body.startswith("big guy"):
  185.       room.message("for you")
  186.  
  187.     if message.body.startswith("!test"):
  188.       room.message("test complete")
  189.  
  190.     if message.body.startswith("!spooky"):
  191.       room.message("http://i.imgur.com/mrFLUKC.gif http://i.imgur.com/mrFLUKC.gif http://i.imgur.com/mrFLUKC.gif")
  192.  
  193.     if message.body.startswith("!tfw"):
  194.       room.message("http://i.imgur.com/amLX3WL.gif http://i.imgur.com/amLX3WL.gif http://i.imgur.com/amLX3WL.gif")
  195.  
  196.     if message.body.startswith("!ayylmao"):
  197.       room.message("http://i.imgur.com/IwxvZMS.gif http://i.imgur.com/IwxvZMS.gif http://i.imgur.com/IwxvZMS.gif")
  198.  
  199.     if message.body.startswith("!isis"):
  200.       room.message("http://i.imgur.com/rbjqEFP.gif http://i.imgur.com/rbjqEFP.gif http://i.imgur.com/rbjqEFP.gif")
  201.  
  202.     if message.body.startswith("!wew"):
  203.       room.message("https://www.youtube.com/watch?v=UPtQFI4qeoE")
  204.  
  205.     if message.body.startswith("!anons"):
  206.       room.message("http://i.imgur.com/iZ4hMgK.gif http://i.imgur.com/Y5vnRI3.gif http://i.imgur.com/G2D7iFF.gif")
  207.  
  208.     if message.body.startswith("!flip"):
  209.       room.message("(ᕗ ಠ︡益︠ಠ︠)ᕗ︵ ┻┻")
  210.  
  211.     if message.body.startswith("!normies"):
  212.       room.message("https://www.youtube.com/watch?v=3qnkOROvhgk")
  213.  
  214.     if message.body.startswith("!loveme"):
  215.       room.message("(っ◔◡◔)っ ❤")
  216.  
  217.     if message.body.startswith("!shitmovie"):
  218.       room.message("http://i.imgur.com/lYU2co6.png")
  219.  
  220.     if message.body.startswith("!mexico"):
  221.       room.message("http://i.imgur.com/UEr2skG.gif http://i.imgur.com/UEr2skG.gif http://i.imgur.com/UEr2skG.gif")
  222.  
  223.   def onFloodBan(self, room):
  224.     print("You are flood banned in "+room.name)
  225.  
  226.   def onPMMessage(self, pm, user, body):
  227.     self.safePrint('PM: ' + user.name + ': ' + body)
  228.     pm.message(user, body) # echo
  229.  
  230.       if cmd == "randomuser":
  231.         room.message(random.choice(room.usernames))
  232.  
  233. rooms = ["magestreambeta"]
  234. username = "golora"
  235. password = "X"
  236.  
  237. TestBot.easy_start(rooms,username,password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement