def del_document(bot, update): chat = update.effective_chat if sql.is_locked(chat.id, "document") and can_delete(chat, bot.id): update.effective_message.delete()