Пример #1
0
def warns(bot: Bot, update: Update, args: List[str]):
    message = update.effective_message  # type: Optional[Message]
    chat = update.effective_chat  # type: Optional[Chat]
    user_id = extract_user(message, args) or update.effective_user.id
    result = sql.get_warns(user_id, chat.id)

    if result and result[0] != 0:
        num_warns, reasons = result
        limit, soft_warn = sql.get_warn_setting(chat.id)

        if reasons:
            text = "Bu istifadəçinin {}/{} xəbərdarlığı var, səbəblər aşağıda verilib:".format(
                num_warns, limit)
            for reason in reasons:
                text += "\n - {}".format(reason)

            msgs = split_message(text)
            for msg in msgs:
                update.effective_message.reply_text(msg)
        else:
            update.effective_message.reply_text(
                "Bu istifadəçinin {}/{} xəbərdarlığı var, amma səbəb verilməyib."
                .format(num_warns, limit))
    else:
        update.effective_message.reply_text(
            "Bu istifadəçinin xəbərdarlığı yoxdu!")
Пример #2
0
def warns(update: Update, context: CallbackContext):
    args = context.args
    message = update.effective_message  # type: Optional[Message]
    chat = update.effective_chat  # type: Optional[Chat]
    user_id = extract_user(message, args) or update.effective_user.id
    result = sql.get_warns(user_id, chat.id)

    if result and result[0] != 0:
        num_warns, reasons = result
        limit, soft_warn = sql.get_warn_setting(chat.id)

        if reasons:
            text = "이 사용자의 경고 횟수는 {}/{} 예요. 이유:".format(num_warns, limit)
            for reason in reasons:
                text += "\n - {}".format(reason)

            msgs = split_message(text)
            for msg in msgs:
                update.effective_message.reply_text(msg)
        else:
            update.effective_message.reply_text(
                "이 사용자의 경고 횟수는 {}/{} 예요. 하지만 아무 이유가 없네요.".format(
                    num_warns, limit))
    else:
        update.effective_message.reply_text("이 사용자에게 경고가 없어요!")
Пример #3
0
def warns(bot: Bot, update: Update, args: List[str]):
    message = update.effective_message  # type: Optional[Message]
    chat = update.effective_chat  # type: Optional[Chat]
    user_id = extract_user(message, args) or update.effective_user.id
    result = sql.get_warns(user_id, chat.id)
    user = update.effective_user
    warned = chat.get_member(user_id).user

    P = 1

    if result and result[0] != 0:
        num_warns, reasons = result
        limit, soft_warn = sql.get_warn_setting(chat.id)

        text = "{} has {}/{} warnings, for the following reasons:".format(
            mention_html(warned.id, warned.first_name), num_warns, limit)
        for reason in reasons:
            text += "\n {}. <code>{}</code>".format(P, reason)
            P = P + 1

        msgs = split_message(text)
        for msg in msgs:
            update.effective_message.reply_text(msg, parse_mode=ParseMode.HTML)

    else:
        update.effective_message.reply_text(
            "{} hasn't got any warnings!".format(
                mention_html(warned.id, warned.first_name)),
            parse_mode=ParseMode.HTML)
Пример #4
0
def warns(update: Update, context: CallbackContext):
    args = context.args
    message: Optional[Message] = update.effective_message
    chat: Optional[Chat] = update.effective_chat
    user_id = extract_user(message, args) or update.effective_user.id
    result = sql.get_warns(user_id, chat.id)

    if result and result[0] != 0:
        num_warns, reasons = result
        limit, soft_warn = sql.get_warn_setting(chat.id)

        if reasons:
            text = (
                f"This user has {num_warns}/{limit} warns, for the following reasons:"
            )
            for reason in reasons:
                text += f"\n • {reason}"

            msgs = split_message(text)
            for msg in msgs:
                update.effective_message.reply_text(msg)
        else:
            update.effective_message.reply_text(
                f"User has {num_warns}/{limit} warns, but no reasons for any of them."
            )
    else:
        update.effective_message.reply_text(
            "This user doesn't have any warns!")
Пример #5
0
def warns(bot: Bot, update: Update, args: List[str]):
    message = update.effective_message  # type: Optional[Message]
    chat = update.effective_chat  # type: Optional[Chat]
    user_id = extract_user(message, args) or update.effective_user.id
    result = sql.get_warns(user_id, chat.id)

    if result and result[0] != 0:
        num_warns, reasons = result
        limit, soft_warn = sql.get_warn_setting(chat.id)

        if reasons:
            text = "ഇയാൾക്ക് {}/{} warnings ഉണ്ട്, കാരണങ്ങൾ താഴെ പറയുന്നു:".format(
                num_warns, limit)
            for reason in reasons:
                text += "\n - {}".format(reason)

            msgs = split_message(text)
            for msg in msgs:
                update.effective_message.reply_text(msg)
        else:
            update.effective_message.reply_text(
                "ഇയാൾക്ക് {}/{} warnings ഉണ്ട്, കാരണം ലഭ്യമല്ല.".format(
                    num_warns, limit))
    else:
        update.effective_message.reply_text(
            "ഇയാൾക്ക് warnings ഒന്നും കിട്ടിയിട്ടില്ല!")
Пример #6
0
def warns(bot: Bot, update: Update, args: List[str]):
    message = update.effective_message  # type: Optional[Message]
    chat = update.effective_chat  # type: Optional[Chat]
    user_id = extract_user(message, args) or update.effective_user.id
    result = sql.get_warns(user_id, chat.id)

    if result and result[0] != 0:
        num_warns, reasons = result
        limit, soft_warn = sql.get_warn_setting(chat.id)

        if reasons:
            text = "This user has {}/{} warnings, for the following reasons:".format(
                num_warns, limit)
            for reason in reasons:
                text += "\n - {}".format(reason)

            msgs = split_message(text)
            for msg in msgs:
                update.effective_message.reply_text(msg)
        else:
            update.effective_message.reply_text(
                "User has {}/{} warnings, but no reasons for any of them.".
                format(num_warns, limit))
    else:
        update.effective_message.reply_text(
            "This user hasn't got any warnings!")
Пример #7
0
def warns(bot: Bot, update: Update, args: List[str]):
    message = update.effective_message  # type: Optional[Message]
    chat = update.effective_chat  # type: Optional[Chat]
    user_id = extract_user(message, args) or update.effective_user.id
    result = sql.get_warns(user_id, chat.id)

    if result and result[0] != 0:
        num_warns, reasons = result
        limit, soft_warn = sql.get_warn_setting(chat.id)

        if reasons:
            text = "Esse usuário tem {}/{} warns, pelos seguintes motivos:".format(
                num_warns, limit)
            for reason in reasons:
                text += "\n - {}".format(reason)

            msgs = split_message(text)
            for msg in msgs:
                update.effective_message.reply_text(msg)
        else:
            update.effective_message.reply_text(
                "Usuário tem {}/{} warns, mas nenhuma razão para eles.".format(
                    num_warns, limit))
    else:
        update.effective_message.reply_text("Esse usuário não tem warns!")
Пример #8
0
def warns(bot: Bot, update: Update, args: List[str]):
    message = update.effective_message  # type: Optional[Message]
    chat = update.effective_chat  # type: Optional[Chat]
    user_id = extract_user(message, args) or update.effective_user.id
    result = sql.get_warns(user_id, chat.id)

    if result and result[0] != 0:
        num_warns, reasons = result
        limit, soft_warn = sql.get_warn_setting(chat.id)

        if reasons:
            text = "Bu kullanıcı aşağıdaki nedenlerle {} / {} uyarılarına sahip:".format(
                num_warns, limit)
            for reason in reasons:
                text += "\n - {}".format(reason)

            msgs = split_message(text)
            for msg in msgs:
                update.effective_message.reply_text(msg)
        else:
            update.effective_message.reply_text(
                "Kullanıcının {} / {} uyarısı var, ancak bunların hiçbir nedeni yok."
                .format(num_warns, limit))
    else:
        update.effective_message.reply_text("Bu kullanıcının hiç uyarısı yok!")
Пример #9
0
def warns(bot: Bot, update: Update, args: List[str]):
    message = update.effective_message  # type: Optional[Message]
    chat = update.effective_chat  # type: Optional[Chat]
    user_id = extract_user(message, args) or update.effective_user.id
    result = sql.get_warns(user_id, chat.id)

    if result and result[0] != 0:
        num_warns, reasons = result
        limit, soft_warn = sql.get_warn_setting(chat.id)

        if reasons:
            text = "यह यूजर के पास है {}/{} चेतावनी, निम्नलिखित कारणों के लिए:".format(
                num_warns, limit)
            for reason in reasons:
                text += "\n - {}".format(reason)

            msgs = split_message(text)
            for msg in msgs:
                update.effective_message.reply_text(msg)
        else:
            update.effective_message.reply_text(
                "यह यूजर के पास है {}/{} चेतावनी, लेकिन उनमें से किसी के लिए कोई कारण नहीं."
                .format(num_warns, limit))
    else:
        update.effective_message.reply_text(
            "इस यूजर को कोई चेतावनी नहीं मिली है!")
Пример #10
0
def warns(bot: Bot, update: Update, args: List[str]):
    message = update.effective_message  # type: Optional[Message]
    chat = update.effective_chat  # type: Optional[Chat]
    user_id = extract_user(message, args) or update.effective_user.id
    result = sql.get_warns(user_id, chat.id)

    if result and result[0] != 0:
        num_warns, reasons = result
        limit, soft_warn = sql.get_warn_setting(chat.id)

        if reasons:
            text = "Is bane ke pas {}/{} warnings h , Ye sab VAJAH h warns ki:".format(
                num_warns, limit)
            for reason in reasons:
                text += "\n - {}".format(reason)

            msgs = split_message(text)
            for msg in msgs:
                update.effective_message.reply_text(msg)
        else:
            update.effective_message.reply_text(
                "User has {}/{} warnings, But koi reason nhu bataye m* ke bache."
                .format(num_warns, limit))
    else:
        update.effective_message.reply_text(
            "Ye sahi insan h warning nhu h abhi tak ek bhi!")
Пример #11
0
def warns(bot: Bot, update: Update, args: List[str]):
    message = update.effective_message  # type: Optional[Message]
    chat = update.effective_chat  # type: Optional[Chat]
    user_id = extract_user(message, args) or update.effective_user.id
    result = sql.get_warns(user_id, chat.id)

    if result and result[0] != 0:
        num_warns, reasons = result
        limit, soft_warn = sql.get_warn_setting(chat.id)

        if reasons:
            text = "Kullanıcının {}/{} uyarısı var, geçerli gerekçeler şunlar:".format(
                num_warns, limit)
            for reason in reasons:
                text += "\n - {}".format(reason)

            msgs = split_message(text)
            for msg in msgs:
                update.effective_message.reply_text(msg)
        else:
            update.effective_message.reply_text(
                "Kullanıcının {}/{} uyarısı var, ama sebepleri belirtilmemiş.".
                format(num_warns, limit))
    else:
        update.effective_message.reply_text(
            "Bu kullanıcının herhangi bir uyarısı yok!")
Пример #12
0
def warns(bot: Bot, update: Update, args: List[str]):
    message = update.effective_message  # type: Optional[Message]
    chat = update.effective_chat  # type: Optional[Chat]
    user_id = extract_user(message, args) or update.effective_user.id
    result = sql.get_warns(user_id, chat.id)

    if result and result[0] != 0:
        num_warns, reasons = result
        limit, soft_warn = sql.get_warn_setting(chat.id)

        if reasons:
            text = "р┤Зр┤пр┤╛р╡╛р┤Хр╡Нр┤Хр╡Н {}/{} warnings р┤Йр┤гр╡Нр┤Яр╡Н, р┤Хр┤╛р┤░р┤гр┤Щр╡Нр┤Щр╡╛ р┤др┤╛р┤┤р╡Ж р┤кр┤▒р┤пр╡Бр┤ир╡Нр┤ир╡Б:".format(
                num_warns, limit)
            for reason in reasons:
                text += "\n - {}".format(reason)

            msgs = split_message(text)
            for msg in msgs:
                update.effective_message.reply_text(msg)
        else:
            update.effective_message.reply_text(
                "р┤Зр┤пр┤╛р╡╛р┤Хр╡Нр┤Хр╡Н {}/{} warnings р┤Йр┤гр╡Нр┤Яр╡Н, р┤Хр┤╛р┤░р┤гр┤В р┤▓р┤нр╡Нр┤пр┤ор┤▓р╡Нр┤▓."
                .format(num_warns, limit))
    else:
        update.effective_message.reply_text(
            "р┤Зр┤пр┤╛р╡╛р┤Хр╡Нр┤Хр╡Н warnings р┤Тр┤ир╡Нр┤ир╡Бр┤В р┤Хр┤┐р┤Яр╡Нр┤Яр┤┐р┤пр┤┐р┤Яр╡Нр┤Яр┤┐р┤▓р╡Нр┤▓!"
        )
Пример #13
0
def warns(bot: Bot, update: Update, args: List[str]):
    message: Optional[Message] = update.effective_message
    chat: Optional[Chat] = update.effective_chat
    user_id = extract_user(message, args) or update.effective_user.id
    result = sql.get_warns(user_id, chat.id)

    if result and result[0] != 0:
        num_warns, reasons = result
        limit, soft_warn = sql.get_warn_setting(chat.id)

        if reasons:
            text = f"This user has {num_warns}/{limit} warnings, for the following reasons:"
            for reason in reasons:
                text += f"\n - {reason}"

            msgs = split_message(text)
            for msg in msgs:
                update.effective_message.reply_text(msg)
        else:
            update.effective_message.reply_text(
                f"User has {num_warns}/{limit} warnings, but no reasons for any of them."
            )
    else:
        update.effective_message.reply_text(
            "This user hasn't got any warnings!")
Пример #14
0
def warns(bot, update, args):
    message = update.effective_message
    user_id = extract_user(message, args) or update.effective_user.id
    warned_user = sql.get_warns(user_id, update.effective_chat.id)
    if warned_user and warned_user.num_warns != 0:
        if warned_user.reasons:
            text = "This user has {} warnings, for the following reasons:".format(warned_user.num_warns)
            for reason in warned_user.reasons:
                text += "\n - {}".format(reason)

            msgs = split_message(text)
            for msg in msgs:
                update.effective_message.reply_text(msg)
        else:
            update.effective_message.reply_text(
                "User has {} warnings, but no reasons for any of them.".format(warned_user.num_warns))
    else:
        update.effective_message.reply_text("This user hasn't got any warnings!")
Пример #15
0
def warns(bot: Bot, update: Update, args: List[str]):
    message = update.effective_message  # type: Optional[Message]
    chat = update.effective_chat  # type: Optional[Chat]
    user_id = extract_user(message, args) or update.effective_user.id
    result = sql.get_warns(user_id, chat.id)

    if result and result[0] != 0:
        num_warns, reasons = result
        limit, soft_warn = sql.get_warn_setting(chat.id)

        if reasons:
            text = "Ten futrzak posiada {}/{} otrzeżeń z następujących powodów:".format(num_warns, limit)
            for reason in reasons:
                text += "\n - {}".format(reason)

            msgs = split_message(text)
            for msg in msgs:
                update.effective_message.reply_text(msg)
        else:
            update.effective_message.reply_text(
                "Ten futrzak posiada {}/{} otrzeżen, ale nie ma podanego powodu dla żadnego z nich.".format(num_warns, limit))
    else:
        update.effective_message.reply_text("Ten futrzak nie ma żadnych ostrzeżeń!")
Пример #16
0
def warns(bot: Bot, update: Update, args: List[str]):
    message = update.effective_message  # type: Optional[Message]
    chat = update.effective_chat  # type: Optional[Chat]
    user_id = extract_user(message, args) or update.effective_user.id
    result = sql.get_warns(user_id, chat.id)

    if result and result[0] != 0:
        num_warns, reasons = result
        limit, soft_warn = sql.get_warn_setting(chat.id)

        if reasons:
            text = "ഈ ഉപഭോക്താവിന്  {}/{} താക്കീതുകൾ ഉണ്ട് , ഇതാണ് അതിന്റെ കാരണങ്ങൾ:".format(num_warns, limit)
            for reason in reasons:
                text += "\n - {}".format(reason)

            msgs = split_message(text)
            for msg in msgs:
                update.effective_message.reply_text(msg)
        else:
            update.effective_message.reply_text(
                "ഉപഭോക്താവിന് {}/{} താക്കീതുകൾ ഉണ്ട് പക്ഷെ ഒന്നിനും കാരണം രേഖപ്പെടുത്തിയിട്ടില്ല .".format(num_warns, limit))
    else:
        update.effective_message.reply_text("ഇദ്ദേഹത്തിന് ഇതുവരെ താക്കീതുകൾ ഒന്നും ലഭിച്ചിട്ടില്ല!")
Пример #17
0
def warns(bot: Bot, update: Update, args: List[str]):
    message = update.effective_message  # type: Optional[Message]
    chat = update.effective_chat  # type: Optional[Chat]
    user_id = extract_user(message, args) or update.effective_user.id
    result = sql.get_warns(user_id, chat.id)

    if result and result[0] != 0:
        num_warns, reasons = result
        limit, soft_warn = sql.get_warn_setting(chat.id)

        if reasons:
            text = "Bu Kullanıcının Aşağıdaki Nedenlerden Dolayı {}/{} Uyarısı Var:".format(num_warns, limit)
            for reason in reasons:
                text += "\n - {}".format(reason)

            msgs = split_message(text)
            for msg in msgs:
                update.effective_message.reply_text(msg)
        else:
            update.effective_message.reply_text(
                "Kullanıcının {}/{} Uyarısı Var, Ancak Bunların Hiçbirinin Nedeni Yok.".format(num_warns, limit))
    else:
        update.effective_message.reply_text("Bu Kullanıcının Herhangi Bir Uyarısı Yok!")
Пример #18
0
def warns(bot: Bot, update: Update, args: List[str]):
    message = update.effective_message  # type: Optional[Message]
    chat = update.effective_chat  # type: Optional[Chat]
    user_id = extract_user(message, args) or update.effective_user.id
    result = sql.get_warns(user_id, chat.id)

    if result and result[0] != 0:
        num_warns, reasons = result
        limit, soft_warn = sql.get_warn_setting(chat.id)

        if reasons:
            text = "Questo utente ha {}/{} ammonimenti, per le seguenti ragioni:".format(num_warns, limit)
            for reason in reasons:
                text += "\n - {}".format(reason)

            msgs = split_message(text)
            for msg in msgs:
                update.effective_message.reply_text(msg)
        else:
            update.effective_message.reply_text(
                "Questo utente ha {}/{} ammonimenti ma per nessuno di essi è indicata una ragione.".format(num_warns, limit))
    else:
        update.effective_message.reply_text("Questo utente non ha ricevuto alcun ammonimento!")
Пример #19
0
def warns(bot: Bot, update: Update, args: List[str]):
    message = update.effective_message  # type: Optional[Message]
    chat = update.effective_chat  # type: Optional[Chat]
    user_id = extract_user(message, args) or update.effective_user.id
    result = sql.get_warns(user_id, chat.id)

    if result and result[0] != 0:
        num_warns, reasons = result
        limit, soft_warn = sql.get_warn_setting(chat.id)

        if reasons:
            text = "Pengguna ini memiliki {}/3 SP, dengan daftar pelanggaran:".format(num_warns)
            for reason in reasons:
                text += "\n - {}".format(reason)

            msgs = split_message(text)
            for msg in msgs:
                update.effective_message.reply_text(msg)
        else:
            update.effective_message.reply_text(
                "Pengguna ini memiliki {}/3 SP".format(num_warns))
    else:
        update.effective_message.reply_text("Pengguna ini tidak memiliki SP")
Пример #20
0
def warns(bot: Bot, update: Update, args: List[str]):
    message = update.effective_message  # type: Optional[Message]
    chat = update.effective_chat  # type: Optional[Chat]
    user_id = extract_user(message, args) or update.effective_user.id
    result = sql.get_warns(user_id, chat.id)

    P = 1

    if result and result[0] != 0:
        num_warns, reasons = result
        limit, soft_warn = sql.get_warn_setting(chat.id)

        text = "This user has {}/{} warnings, for the following reasons:".format(num_warns, limit)
        for reason in reasons:
            text += "\n {}. `{}`".format(P, reason)
            P = P + 1

        msgs = split_message(text)
        for msg in msgs:
            update.effective_message.reply_text(msg, parse_mode=ParseMode.MARKDOWN)

    else:
        update.effective_message.reply_text("This user hasn't got any warnings!")