Advertisement
hanseel

Untitled

Jan 15th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. if cmd == "udf" and len(args) > 0:
  2. try:
  3. word = args
  4. if word in dictionary:
  5. definition, name = json.loads(dictionary[word])
  6. if name == user.name or self.getAccess(user) >= 3:
  7. del dictionary[word]
  8. f =open("definitions.txt", "w")
  9. for word in dictionary:
  10. definition, name = json.loads(dictionary[word])
  11. f.write(json.dumps([word, definition, name])+"\n")
  12. f.close
  13. room.message(args+" has been removed from Definition database")
  14. return
  15. else:
  16. room.message("<b>%s</b> you can not remove this define only masters or the person who defined the word may remove definitions" % user.name, True)
  17. return
  18. else:
  19. room.message("<b>%s</b> is not yet defined you can define it by typing <b>define %s: meaning</b>" % args, True)
  20. except:
  21. room.message("can't")
  22. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement