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)
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))
def flood(bot: Bot, update: Update): chat = update.effective_chat update_chat_title = chat.title message_chat_title = update.effective_message.chat.title if update_chat_title == message_chat_title: chat_name = "" else: chat_name = f" in <b>{update_chat_title}</b>" limit = sql.get_flood_limit(chat.id) if limit == 0: update.effective_message.reply_text( f"I'm not currently enforcing flood control{chat_name}!", parse_mode=ParseMode.HTML) else: update.effective_message.reply_text( f"I'm currently kicking users if they send " f"more than {limit} consecutive messages{chat_name}.", parse_mode=ParseMode.HTML)
def __chat_settings__(chat_id, user_id): limit = sql.get_flood_limit(chat_id) if limit == 0: return "*Not* currently enforcing flood control." else: return "Antiflood is set to `{}` messages.".format(limit)