Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import chlib
- import random
- import sys
- import re
- ##Dance moves!
- dancemoves = [
- "(>^.^)>",
- "(v^.^)v",
- "v(^.^v)",
- "<(^.^<)"
- ]
- import chlib
- class Bot(chlib.ConnectionManager):
- def start(self):
- groups = ["bigherosix"] #list your group names instead
- for group in groups:
- self.addGroup(group)
- self.prefix = "!" #optional, just won't call any commands if not specified.
- def recvdenied(self, group):
- print("Failed to connect to "+group.name)
- def recvinited(self, group):
- print("Connected to "+group.name)
- def recvOK(self, group):
- print("Connected to "+group.name)
- def recvRemove(self, group):
- print("Disconnected from "+group.name)
- def recvCommand(self, group, user, auth, post, cmd, args):
- if cmd == "a":
- group.sendPost("AAAAAAAAAAAAAA")
- def recvPost(self, group, user, post):
- print(user+": "+post.post)
- def recvmsg(self, group, user, pm):
- print("PM: "+user+": "+pm)
- self.sendPM(user, pm) # echo
- def recvkickingoff(self, group):
- self.removeGroup(group.name)
- self.addGroup(group.name)
- def recvtoofast(self, group):
- self.removeGroup(group.name)
- self.addGroup(group.name)
- if cmd == "say":
- room.message(args)
- ##Random User
- if cmd == "randomuser":
- room.message(random.choice(room.usernames))
- ##Check Level
- if cmd == "mylvl":
- room.message("Your mod level: %i" %(room.getLevel(user)))
- ##List Mods
- if cmd == "mods":
- room.message(", ".join(room.modnames + [room.ownername]))
- #Dance
- if cmd == "dance":
- for i, msg in enumerate(dancemoves):
- self.setTimeout(i / 2, room.message, msg)
- if __name__ == "__main__": #no easy starting this time ;D
- bot = Bot(user = "", password = "", pm = True)
- bot.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement