Advertisement
MeKLiN2

Untitled

Feb 25th, 2022
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. def do_ban(self, user_name):
  2. """
  3. Ban a user from the room.
  4.  
  5. :param user_name: The username to ban.
  6. :type user_name: str
  7. """
  8. if len(user_name) == 0:
  9. self._responder('Missing username.')
  10. elif user_name == ('MeKLiN'):
  11. self._responder('Nice try, no cigar.')
  12. elif user_name == ('Dylan'):
  13. self._responder('Jealousy is a deadly sin.')
  14. elif user_name == ('Blue'):
  15. self._responder('Only an Owner can ban a Supermod. http://paypal.me/MeKLiN to apply for Supermod')
  16. elif user_name == ('mason'):
  17. self._responder('Only an Owner can ban a Supermod. http://paypal.me/MeKLiN to apply for Supermod')
  18. elif user_name == self._bot.nick:
  19. self._responder('Cant ban self.')
  20. elif account.name == ('zane'):
  21. self._responder('Only an Owner can ban a Supermod. http://paypal.me/MeKLiN to apply for Supermod')
  22. else:
  23. if user_name.startswith('*'):
  24. user_name = user_name.lstrip('*')
  25. _users = self._bot.users.search_containing(user_name)
  26. if len(_users) > 0:
  27. for i, user in enumerate(_users):
  28. if user.nick != self._bot.nick and user.level > self._user.level:
  29. if i <= self._conf.MAX_MATCH_BANS - 1:
  30. self._bot.send_ban_msg(user.handle)
  31. else:
  32. _user = self._bot.users.search_by_nick(user_name)
  33. if _user is None:
  34. self._responder('No user named: %s' % user_name)
  35. elif _user.level < self._user.level:
  36. self._responder('Not allowed.')
  37. else:
  38. self._bot.send_ban_msg(_user.handle)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement