def kick_handler(message): """ Kicks member """ if config_func.in_mf(message, 'boss_commands', or_private=False) and config_func.is_suitable( message, message.from_user, 'boss'): person = config_func.Analyzer(message, value_necessary=False).return_target_person() if person and config_func.rank_superiority(message, person): boss_commands.ban(message, person, unban_then=True)
def rank_changer_handler(message): """Changes person's rank""" if config_func.in_mf(message, command_type=None, or_private=False): if config_func.is_suitable(message, message.from_user, 'uber'): person = config_func.Analyzer(message, value_necessary=False).return_target_person(to_self=True) if person: if person.id == message.from_user.id or config_func.rank_superiority(message, person): boss_commands.rank_changer(message, person)
def mute_handler(message): """ Mutes member """ if config_func.in_mf(message, "boss_commands", or_private=False) and config_func.is_suitable( message, message.from_user, 'boss'): analyzer = config_func.Analyzer(message, default_value=1, value_positive=True) person = analyzer.return_target_person() parameters_dictionary = analyzer.parameters_dictionary if person and config_func.rank_superiority(message, person) and parameters_dictionary: boss_commands.mute(message, person, parameters_dictionary)
def warn_handler(message): """Даёт участнику предупреждение""" if config_func.in_mf(message, 'boss_commands', or_private=False) and config_func.is_suitable( message, message.from_user, 'boss'): rep = message.reply_to_message if rep: analyzer = config_func.Analyzer(message, default_value=1, value_positive=True) parameters_dictionary = analyzer.parameters_dictionary if analyzer.check_person(rep.from_user, False, False) \ and config_func.rank_superiority(message, rep.from_user): if parameters_dictionary: boss_commands.warn(message, rep.from_user, parameters_dictionary) else: output.reply( message, "Надо ответить на сообщение с актом преступления, чтобы переслать контекст\ в хранилище")