Exemple #1
0
def __user_info__(user_id, chat_id):
    is_gbanned = sql.is_user_gbanned(user_id)
    is_gmuted = sql.is_user_gmuted(user_id)

    if not user_id in SUDO_USERS:

        text = tld(chat_id,"antispam_gban")
        if is_gbanned:
            text = text.format(tld(chat_id, "antispam_yes"))
            user = sql.get_gbanned_user(user_id)
            if user.reason:
                text += tld(chat_id, "antispam_reason").format(html.escape(user.reason))
        else:
            text = text.format(tld(chat_id, "antispam_no"))
        
        text += tld(chat_id,"antispam_gmuted")
        if is_gmuted:
            text = text.format(tld(chat_id, "antispam_yes"))
            user = sql.get_gmuted_user(user_id)
            if user.reason:
                text += tld(chat_id, "antispam_reason").format(html.escape(user.reason))
        else:
            text = text.format(tld(chat_id, "antispam_no"))

        return text
    else:
        return ""
Exemple #2
0
def __user_info__(user_id, chat_id):
    is_gbanned = sql.is_user_gbanned(user_id)
    is_gmuted = sql.is_user_gmuted(user_id)

    if not user_id in SUDO_USERS:

        text = tld(chat_id, "Globally banned: <b>{}</b>")
        if is_gbanned:
            text = text.format(tld(chat_id, "Yes"))
            user = sql.get_gbanned_user(user_id)
            if user.reason:
                text += tld(chat_id,
                            "\nReason: {}").format(html.escape(user.reason))
        else:
            text = text.format(tld(chat_id, "No"))

        text += tld(chat_id, "\nGlobally muted: <b>{}</b>")
        if is_gmuted:
            text = text.format(tld(chat_id, "Yes"))
            user = sql.get_gmuted_user(user_id)
            if user.reason:
                text += tld(chat_id,
                            "\nReason: {}").format(html.escape(user.reason))
        else:
            text = text.format(tld(chat_id, "No"))

        return text
    else:
        return ""
Exemple #3
0
def __user_info__(user_id, chat_id):
    is_gbanned = sql.is_user_gbanned(user_id)
    is_gmuted = sql.is_user_gmuted(user_id)

    if not user_id in SUDO_USERS or not user_id in WHITELIST_USERS:

        text = tld(chat_id, "antispam_userinfo_gbanned")
        if is_gbanned:
            text = text.format(tld(chat_id, "common_yes"))
            text += tld(chat_id, "anitspam_appeal")
            user = sql.get_gbanned_user(user_id)
            if user.reason:
                text += tld(chat_id, "antispam_userinfo_gban_reason").format(
                    html.escape(user.reason))
        else:
            text = text.format(tld(chat_id, "common_no"))

        text += tld(chat_id, "antispam_userinfo_gmute")
        if is_gmuted:
            text = text.format(tld(chat_id, "common_yes"))
            text += tld(chat_id, "anitspam_appeal")
            user = sql.get_gmuted_user(user_id)
            if user.reason:
                text += tld(chat_id, "antispam_userinfo_gmute_reason").format(html.escape(user.reason))
        else:
            text = text.format(tld(chat_id, "common_no"))

        return text
    else:
        return ""