Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ch
- class bot(ch.RoomManager):
- def onInit(self):
- print("\n[-] <bot_name> initialized")
- self.setNameColor("000000")
- self.setFontColor("000000")
- self.setFontFace("Arial")
- self.setFontSize(12)
- #self.enableBg()
- def onConnect(self, room):
- print("\n[-] connected to "+room.name+"\n")
- def onReconnect(self, room):
- print("\n[-] reconnected to "+room.name+"\n")
- def onDisconnect(self, room):
- print("\n[!] disconnected from "+room.name+"\n")
- def onMessage(self, room, user, message):
- print("\t{0}: {1}".format(user.name,message.body))
- if self.user == user: return
- msg_data = message.body.split(" ",1)
- if len(msg_data) > 1:
- cmd, args = msg_data[0], msg_data[1]
- else:
- cmd, args = msg_data[0],""
- cmd = cmd.lower()
- args = args.lower()
- msg = message.body.lower()
- if len(cmd) > 0:
- #if cmd[0] in prefixes:
- if cmd[0] == "/":
- iscmd = True
- cmd = cmd[1:]
- else:
- iscmd = False
- if iscmd:
- if cmd == "say":
- room.message(args)
- rooms = ["room_1","room_2"]
- username = "bot_name"
- password = "password"
- bot.easy_start(rooms,username,password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement