Aluf

Timeout mod ban command

Jan 18th, 2015
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.97 KB | None | 0 0
  1.     ###########################
  2.     #timeout - Ban
  3.     ###########################
  4.     elif used_prefix and cmd=="timeout" and user.name.lower()=="digitalclay" and len(args)>0:
  5.       try:
  6.         #split args into name , time
  7.         tname,timez=args.split(" ",1)
  8.         #make time string into an int
  9.         timez=int(timez)
  10.         #banuser name
  11.         room.banUser(botlib.User(tname.lower()))
  12.         #print message
  13.         room.message(tname+" has been banned for : "+str(timez)+" Seconds....")
  14.         #set the unban command to the timeout time
  15.         self.setTimeout(int(timez),room.unban,botlib.User(tname.lower()))
  16.         #set the message timeout to the bantime + 3 more seconds(just cuz)
  17.         self.setTimeout(int(timez+3),room.message," OK , you chat abuser...your "+str(timez)+" second ban is up.You
  18. are now unbanned")
  19.       except Exception:
  20.         #if there is an error , print the error code in the chatroom
  21.         room.message(str(sys.exc_info()),False)
Advertisement
Add Comment
Please, Sign In to add comment