def clean_blue_text_must_click(bot: Bot, update: Update): chat = update.effective_chat message = update.effective_message cmd = message.text.strip().split(None, 1)[0].split("/")[1] if sql.is_enable(chat.id): if not sql.is_command_ignored(cmd): message.delete()
def clean_blue_text_must_click(update: Update, context: CallbackContext): bot = context.bot chat = update.effective_chat message = update.effective_message if chat.get_member(bot.id).can_delete_messages and sql.is_enabled(chat.id): fst_word = message.text.strip().split(None, 1)[0] if len(fst_word) > 1 and any( fst_word.startswith(start) for start in CMD_STARTERS): command = fst_word[1:].split("@") chat = update.effective_chat ignored = sql.is_command_ignored(chat.id, command[0]) if ignored: return if command[0] not in command_list: message.delete()