Advertisement
Guest User

asdf

a guest
May 19th, 2015
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. import chlib
  2. import random
  3. import sys
  4. import re
  5.  
  6.  
  7. ##Dance moves!
  8.  
  9.  
  10. dancemoves = [
  11. "(>^.^)>",
  12. "(v^.^)v",
  13. "v(^.^v)",
  14. "<(^.^<)"
  15. ]
  16.  
  17. import chlib
  18.  
  19. class Bot(chlib.ConnectionManager):
  20.  
  21. def start(self):
  22. groups = ["bigherosix"] #list your group names instead
  23. for group in groups:
  24. self.addGroup(group)
  25. self.prefix = "!" #optional, just won't call any commands if not specified.
  26.  
  27. def recvdenied(self, group):
  28. print("Failed to connect to "+group.name)
  29.  
  30. def recvinited(self, group):
  31. print("Connected to "+group.name)
  32.  
  33. def recvOK(self, group):
  34. print("Connected to "+group.name)
  35.  
  36. def recvRemove(self, group):
  37. print("Disconnected from "+group.name)
  38.  
  39. def recvCommand(self, group, user, auth, post, cmd, args):
  40. if cmd == "a":
  41. group.sendPost("AAAAAAAAAAAAAA")
  42.  
  43. def recvPost(self, group, user, post):
  44. print(user+": "+post.post)
  45.  
  46. def recvmsg(self, group, user, pm):
  47. print("PM: "+user+": "+pm)
  48. self.sendPM(user, pm) # echo
  49.  
  50. def recvkickingoff(self, group):
  51. self.removeGroup(group.name)
  52. self.addGroup(group.name)
  53.  
  54. def recvtoofast(self, group):
  55. self.removeGroup(group.name)
  56. self.addGroup(group.name)
  57. if cmd == "say":
  58. room.message(args)
  59. ##Random User
  60.  
  61. if cmd == "randomuser":
  62. room.message(random.choice(room.usernames))
  63. ##Check Level
  64.  
  65. if cmd == "mylvl":
  66. room.message("Your mod level: %i" %(room.getLevel(user)))
  67. ##List Mods
  68.  
  69. if cmd == "mods":
  70. room.message(", ".join(room.modnames + [room.ownername]))
  71.  
  72.  
  73. #Dance
  74. if cmd == "dance":
  75. for i, msg in enumerate(dancemoves):
  76. self.setTimeout(i / 2, room.message, msg)
  77.  
  78.  
  79. if __name__ == "__main__": #no easy starting this time ;D
  80. bot = Bot(user = "", password = "", pm = True)
  81. bot.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement