Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def do_ban(self, user_name):
- """
- Ban a user from the room.
- :param user_name: The username to ban.
- :type user_name: str
- """
- if len(user_name) == 0:
- self._responder('Missing username.')
- elif user_name == ('MeKLiN'):
- self._responder('Nice try, no cigar.')
- elif user_name == ('Dylan'):
- self._responder('Jealousy is a deadly sin.')
- elif user_name == ('Blue'):
- self._responder('Only an Owner can ban a Supermod. http://paypal.me/MeKLiN to apply for Supermod')
- elif user_name == ('mason'):
- self._responder('Only an Owner can ban a Supermod. http://paypal.me/MeKLiN to apply for Supermod')
- elif user_name == self._bot.nick:
- self._responder('Cant ban self.')
- elif account.name == ('zane'):
- self._responder('Only an Owner can ban a Supermod. http://paypal.me/MeKLiN to apply for Supermod')
- else:
- if user_name.startswith('*'):
- user_name = user_name.lstrip('*')
- _users = self._bot.users.search_containing(user_name)
- if len(_users) > 0:
- for i, user in enumerate(_users):
- if user.nick != self._bot.nick and user.level > self._user.level:
- if i <= self._conf.MAX_MATCH_BANS - 1:
- self._bot.send_ban_msg(user.handle)
- else:
- _user = self._bot.users.search_by_nick(user_name)
- if _user is None:
- self._responder('No user named: %s' % user_name)
- elif _user.level < self._user.level:
- self._responder('Not allowed.')
- else:
- self._bot.send_ban_msg(_user.handle)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement