コード例 #1
0
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)
コード例 #2
0
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)