Exemplo n.º 1
0
def check_and_ban(update, user_id, should_message=True):

    try:
        spmban = spamwtc.get_ban(int(user_id))
        if spmban:
            update.effective_chat.kick_member(user_id)
            if should_message:
                update.effective_message.reply_markdown(
                    "*This user is detected as potential Spambot by SpamWatch and have been removed!*\nVisit @SpamWatchSupport to Appeal!"
                )
                return
            else:
                return

    except:
        pass

    if sql.is_user_gbanned(user_id):
        update.effective_chat.kick_member(user_id)
        if should_message:
            usr = sql.get_gbanned_user(user_id)
            greason = usr.reason
            if not greason:
                greason = "No reason given"

            update.effective_message.reply_text(
                f"*Alert! this user was GBanned and have been removed!*\n*Reason*: {greason}",
                parse_mode=ParseMode.MARKDOWN)

            return
Exemplo n.º 2
0
def check_and_ban(update, user_id, should_message=True):

    try:
        spmban = spamwtc.get_ban(int(user_id))
        if spmban:
            update.effective_chat.kick_member(user_id)
            if should_message:
                update.effective_message.reply_text(
                    f"This person has been detected as spambot by @SpamWatch and has been removed!\nReason: <code>{spmban.reason}</code>",
                    parse_mode=ParseMode.HTML,
                )
                return
            else:
                return
    except Exception:
        pass

    if sql.is_user_gbanned(user_id):
        update.effective_chat.kick_member(user_id)
        if should_message:
            usr = sql.get_gbanned_user(user_id)
            greason = usr.reason
            if not greason:
                greason = "No reason given"

            update.effective_message.reply_text(
                f"*Alert! this user was GBanned and have been removed!*\n*Reason*: {greason}",
                parse_mode=ParseMode.MARKDOWN,
            )
            return
Exemplo n.º 3
0
def __user_info__(user_id):
    is_gbanned = sql.is_user_gbanned(user_id)

    text = "<b>Globally banned</b>: {}"

    if is_gbanned:
        text = text.format("Yes")
        user = sql.get_gbanned_user(user_id)
        if user.reason:
            text += "\nReason: {}".format(html.escape(user.reason))
    else:
        text = text.format("No")
    return text
Exemplo n.º 4
0
def __user_info__(user_id):
    is_gbanned = sql.is_user_gbanned(user_id)

    text = "<b>Globally banned</b>: {}"

    if is_gbanned:
        text = text.format("Yes")
        user = sql.get_gbanned_user(user_id)
        if user.reason:
            text += "\nReason: {}".format(html.escape(user.reason))
            text += "\n\nAppeal at @skyleebot if you think it's invalid."
    else:
        text = text.format("No")
    return text
Exemplo n.º 5
0
def check_and_ban(update, user_id, should_message=True):

    if sql.is_user_gbanned(user_id):
        update.effective_chat.kick_member(user_id)
        if should_message:
            usr = sql.get_gbanned_user(user_id)
            greason = usr.reason
            if not greason:
                greason = "No reason given"

            update.effective_message.reply_text(
                f"*Alert! this user was GBanned and have been removed!*\n*Reason*: {greason}",
                parse_mode=ParseMode.MARKDOWN,
            )
            return
Exemplo n.º 6
0
def __user_info__(user_id):
    is_gbanned = sql.is_user_gbanned(user_id)

    text = "<b>Globally banned</b>: {}"

    if int(user_id) in SUDO_USERS + SUPPORT_USERS:
        return ""
    if is_gbanned:
        text = text.format("Yes")
        user = sql.get_gbanned_user(user_id)
        if user.reason:
            text += "\nReason: {}".format(html.escape(user.reason))
            text += "\n\nAppeal at @MeikosupportChat if you think it's a Mistake !"
    else:
        text = text.format("No")
    return text
Exemplo n.º 7
0
def __user_info__(user_id):
    is_gbanned = sql.is_user_gbanned(user_id)

    text = "<b>Globally banned</b>: {}"

    if int(user_id) in SUDO_USERS + SUPPORT_USERS:
        return ""
    if is_gbanned:
        text = text.format("Yes")
        user = sql.get_gbanned_user(user_id)
        if user.reason:
            text += "\nReason: {}".format(html.escape(user.reason))
            text += "\n\nAppeal at @indoloaderwaitingarea if you think it's invalid."
    else:
        text = text.format("No")
    return text