Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###########################
- #timeout - Ban
- ###########################
- elif used_prefix and cmd=="timeout" and user.name.lower()=="digitalclay" and len(args)>0:
- try:
- #split args into name , time
- tname,timez=args.split(" ",1)
- #make time string into an int
- timez=int(timez)
- #banuser name
- room.banUser(botlib.User(tname.lower()))
- #print message
- room.message(tname+" has been banned for : "+str(timez)+" Seconds....")
- #set the unban command to the timeout time
- self.setTimeout(int(timez),room.unban,botlib.User(tname.lower()))
- #set the message timeout to the bantime + 3 more seconds(just cuz)
- self.setTimeout(int(timez+3),room.message," OK , you chat abuser...your "+str(timez)+" second ban is up.You
- are now unbanned")
- except Exception:
- #if there is an error , print the error code in the chatroom
- room.message(str(sys.exc_info()),False)
Advertisement
Add Comment
Please, Sign In to add comment