Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ch
- import sys
- import random
- import sqlite3
- ################################################################################################################################################################################################################################################
- from xml.etree import cElementTree as ET
- if sys.version_info[0] > 2:
- import urllib.request as urlreq
- else:
- import urllib2 as urlreq
- ################################################################################################################################################################################################################################################
- prefix = "."
- ################################################################################################################################################################################################################################################
- class bot (ch.RoomManager):
- ################################################################################################################################################################################################################################################
- def onInit(self):
- self.setNameColor("FF0000")
- self.setFontColor("00BFFF0")
- self.setFontFace("Papyrus")
- self.setFontSize(14)
- self.enableBg()
- self.enableRecording()
- ################################################################################################################################################################################################################################################
- def onConnect(self,room):
- print ("[INFO] Connected to : "+room.name)
- self.setNameColor("FF0000")
- self.setFontColor("00BFFF")
- self.setFontFace("Papyrus")
- self.setFontSize(14)
- self.enableBg()
- self.enableRecording()
- room.message("Hello people of this Realm! I am Botler and I will serve you in any way possible. Type .cmd or .cmds If you need any of my multiple services!")
- ################################################################################################################################################################################################################################################
- def onReconnect (self,room):
- print ("[INFO] Reconnected to : "+room.name)
- self.setNameColor("FF0000")
- self.setFontColor("00BFFF")
- self.setFontFace("Papyrus")
- self.setFontSize(14)
- self.enableBg()
- self.enableRecord()
- room.message("Hello people of this Realm! I am Botler and I will serve you in any way possible. Type .cmd or .cmds If you need any of my multiple services!")
- ################################################################################################################################################################################################################################################
- def onDisconnect(self,room):
- print("[INFO] Discconected from : "+room.name)
- ################################################################################################################################################################################################################################################
- def onFloodWarning(self,room):
- print("{INFO} FloodWarning in : "+room.name)
- room.reconnect()
- ################################################################################################################################################################################################################################################
- def onMessage(self,room,user,message):
- print(user.name+" : "+message.body)
- msgdata = message.body.split(" ",1)
- if len(msgdata) > 1:
- cmd, args = msgdata[0], msgdata[1]#if command and argument
- else:
- cmd, args = msgdata[0],""#if command and no argument
- cmd=cmd.lower()
- if len(cmd)>0:
- if cmd[0]==prefix:
- used_prefix = True
- cmd = cmd[1:]
- else:
- used_prefix= False
- else:
- return
- ################################################################################################################################################################################################################################################
- if used_prefix and cmd == "cmds":
- room.message("Available Services: Dice, Fml, Cmd, Cmds, Coin, 8Ball, Spin(B), Sleep(A), Wakeup(A), Rules")
- if used_prefix and cmd == "cmd":
- room.message("Available Services: Dice, Fml, Cmd, Cmds, Coin, 8Ball, Spin(B), Sleep(A), Wakeup(A), Rules")
- ################################################################################################################################################################################################################################################
- if used_prefix and cmd == "rules":
- room.message("1. No links to other ChatRooms //"+
- " 2. No spam //"+
- " 3. English only //"+
- " 4. Respect eachother //"+
- " 5. We're giving 2 Warnings //"
- " Enjoy @"+user.name)
- ################################################################################################################################################################################################################################################
- if used_prefix and cmd == "dice":
- dice=random.randint(1,100)
- room.message("Botler gave the dice to @"+ user.name +" and "+" rolled : "+str(dice))
- ################################################################################################################################################################################################################################################
- if used_prefix and cmd =="coin":
- room.message(random.choice(["I flipped a coin and it lands on heads.",
- "I flipped a coin and it lands on tails.",]))
- ################################################################################################################################################################################################################################################
- if used_prefix and cmd =="spin" and room.userlist:
- room.message("Botler spins the bottle and points at @"+(random.choice(room.usernames)))
- ################################################################################################################################################################################################################################################
- if used_prefix and cmd =="8ball":
- room.message(random.choice(["Ofcourse!",
- "Ofcourse not!",
- "Yes!",
- "No!",
- "Absolutely!",
- "Absolutely Not!",
- "I don't know, do you know?",
- "I doubt it!",
- "Without doubt!",
- "Yup!",
- "Nope!",
- "I'm sure you know that yourself!",
- "I won't answer that!",
- "Maybe"]))
- ################################################################################################################################################################################################################################################
- rooms=["beatsbydre69"]
- if __name__ == "__main__":
- bot.easy_start(rooms, "botler", "thebuttler")
- ################################################################################################################################################################################################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement