Beispiel #1
0
def __chat_settings__(chat_id, user_id):
    limit = sql.get_flood_limit(chat_id)
    soft_flood = sql.get_flood_strength(chat_id)
    if limit == 0:
        return "*Not* currently enforcing flood control."
    else:
        if soft_flood:
            return "Anti-flood is set to `{}` messages and *KICK* if exceeded.".format(limit)
        else:
            return "Anti-flood is set to `{}` messages and *BAN* if exceeded.".format(limit)
Beispiel #2
0
def flood(bot: Bot, update: Update):
    chat = update.effective_chat  # type: Optional[Chat]
    msg = update.effective_message # type: Optional[Message]
    limit = sql.get_flood_limit(chat.id)
    if limit == 0:
        update.effective_message.reply_text("I'm not currently enforcing flood control!")
    else:
        soft_flood = sql.get_flood_strength(chat.id)
        if soft_flood:
            msg.reply_text("I'm currently kicking users out if they send more than {} " 
                           "consecutive messages. They will able to join again!".format(limit, parse_mode=ParseMode.MARKDOWN))
        else:
            msg.reply_text("I'm currently banning users if they send more than {} " 
                           "consecutive messages.".format(limit, parse_mode=ParseMode.MARKDOWN))