def warns_top_handler(message): """ Show all warns """ if config_func.in_mf(message, command_type=None, or_private=False): language = config_func.get_one_language(message) if language: args = message, language, '{index}. {p_link} — {warns} ⛔️\n' kwargs = {'start': 'Количество варнов:\n\n', 'sort_key': lambda x: x['warns']} standard_commands.send_some_top(*args, **kwargs)
def birthday_handler(message): """Show the nearest birthdays""" if config_func.in_mf(message, command_type=None): language = config_func.get_one_language(message) if language: standard_commands.send_some_top( message, language, '{index}. {p_link} — {day} {month}\n', sort_key=lambda x: -100 * x['month_birthday'] - x['day_birthday'])
def messages_top_handler(message): """Messages top""" if config_func.in_mf(message, command_type=None, or_private=False): language = config_func.get_one_language(message) if language: args = message, language, '{index}. {p_link} — {messages} сообщ.\n' kwargs = {'sort_key': lambda x: x['messages']} if config_func.is_suitable(message, message.from_user, 'boss', loud=False): standard_commands.send_some_top(*args, **kwargs) else: standard_commands.send_short_top(*args, **kwargs)
def money_top_handler(message): """Топ ЯМ""" if config_func.in_mf(message, 'financial_commands', or_private=False): language = config_func.get_one_language(message) if language: args = message, language, '{index}. {p_link} — {money} {m_emo}\n' kwargs = {'start': 'Бюджет: {bot_money} {m_emo}\n\n', 'sort_key': lambda x: x['money']} if config_func.is_suitable(message, message.from_user, 'boss', loud=False): standard_commands.send_some_top(*args, **kwargs) else: standard_commands.send_short_top(*args, **kwargs)
def all_members_handler(message): """Присылает человеку все записи в БД""" if config_func.in_mf(message, command_type=None, or_private=False): language = config_func.get_one_language(message) if language: if config_func.is_suitable(message, message.from_user, 'boss', loud=False): standard_commands.send_some_top(message, language, '{index}. <code>{id}</code> {p_link}\n') else: standard_commands.send_some_top(message, language, '{index}. <code>{id}</code> {nickname}\n')