picapi_

Untitled

Dec 31st, 2015
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #Put this inside of the OnMessage function. ([] are optional, prevents mods from being kicked for caps.)
  2.  
  3. #Kick CapsLock and send a message
  4. if message.content.isupper() and len(message.content) > 5 [and IsMod(message.author) == False] :
  5. client.send_message(message.author, "You have been kicked from the server for all caps. Please avoid doing this in the future. Feel free to rejoin, however repeating this action may result in heavier sanctions.")
  6. client.kick(message.server, message.author)
  7. client.send_message(message.channel, message.author.name+" was kicked for using all caps.")
  8. [
  9. #Put this near the top of the script
  10.  
  11. def IsMod(member):
  12. for x in member.roles:
  13. if x.name == "Moderator":
  14. return True
  15. return False
  16. ]
Advertisement
Add Comment
Please, Sign In to add comment