Ejemplo n.º 1
0
async def _(event):
    if event.is_private:
        return
    if event.is_group:
        if not await can_change_info(message=event):
            return
    chat_id = event.chat_id
    limit = sql.get_flood_limit(chat_id)
    if limit == 0:
        await event.reply("I'm not enforcing any flood control here!")
    else:
        await event.reply(
            "I'm currently restricting members after {} consecutive messages.".
            format(limit))
Ejemplo n.º 2
0
def flood(update, context):
    chat = update.effective_chat  # type: Optional[Chat]
    user = update.effective_user  # type: Optional[User]
    msg = update.effective_message

    if update.effective_message.chat.type == "private":
        send_message(
            update.effective_message,
            "This command is meant to use in group not in PM",
        )
        return
    chat_id = update.effective_chat.id
    chat_name = update.effective_message.chat.title

    limit = sql.get_flood_limit(chat_id)
    if limit == 0:
        text = msg.reply_text("I'm not enforcing any flood control here!")
        send_message(update.effective_message, text, parse_mode="markdown")
    else:
        text = msg.reply_text(
            "I'm currently restricting members after {} consecutive messages.".
            format(limit))
        send_message(update.effective_message, text, parse_mode="markdown")
Ejemplo n.º 3
0
def __chat_settings__(chat_id, user_id):
    limit = sql.get_flood_limit(chat_id)
    if limit == 0:
        return "Not enforcing to flood control."
    return "Antiflood has been set to`{}`.".format(limit)